Skip to content

Commit c868118

Browse files
authored
chore(4.3-stable): bump to main (#9179)
2 parents cb004fd + 0db42e4 commit c868118

220 files changed

Lines changed: 15473 additions & 6346 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Create rnc-cli app
2+
description: Scaffold a React Native app with Reanimated and Worklets installed
3+
inputs:
4+
react-native-version:
5+
description: React Native version to use
6+
required: true
7+
reanimated-version:
8+
description: Reanimated version to install
9+
required: true
10+
worklets-version:
11+
description: Worklets version to install
12+
required: true
13+
app-name:
14+
description: Name of the test app
15+
default: 'app'
16+
required: false
17+
18+
runs:
19+
using: 'composite'
20+
steps:
21+
- name: Resolve rnc-cli version
22+
id: cli-version
23+
shell: bash
24+
run: echo "version=$(npm view @react-native-community/cli version)" >> "$GITHUB_OUTPUT"
25+
26+
- name: Restore app cache
27+
id: app-cache
28+
uses: actions/cache/restore@v4
29+
with:
30+
path: ${{ inputs.app-name }}
31+
key: rnc-cli-app-${{ runner.os }}-${{ steps.cli-version.outputs.version }}-${{ inputs.react-native-version }}
32+
33+
- name: Create app
34+
if: steps.app-cache.outputs.cache-hit != 'true'
35+
shell: bash
36+
run: |
37+
npx @react-native-community/cli init ${{ inputs.app-name }} \
38+
--version "${{ inputs.react-native-version }}" \
39+
--skip-install \
40+
--install-pods 0 \
41+
--skip-git-init
42+
43+
- name: Save app cache
44+
if: steps.app-cache.outputs.cache-hit != 'true'
45+
uses: actions/cache/save@v4
46+
with:
47+
path: ${{ inputs.app-name }}
48+
key: rnc-cli-app-${{ runner.os }}-${{ steps.cli-version.outputs.version }}-${{ inputs.react-native-version }}
49+
50+
- name: Install Reanimated and Worklets
51+
working-directory: ${{ inputs.app-name }}
52+
shell: bash
53+
run: |
54+
npm install "react-native-reanimated@${{ inputs.reanimated-version }}"
55+
npm install "react-native-worklets@${{ inputs.worklets-version }}"
56+
57+
- name: Setup Ruby (iOS)
58+
if: ${{ runner.os == 'macOS' }}
59+
uses: ruby/setup-ruby@v1
60+
with:
61+
ruby-version: '3.3' # Not needed with a `.ruby-version` or `.tool-versions`
62+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
63+
64+
- name: Install Pods (iOS)
65+
if: ${{ runner.os == 'macOS' }}
66+
working-directory: ${{ inputs.app-name }}/ios
67+
shell: bash
68+
run: bundle install && bundle exec pod install
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
const fs = require('fs');
2+
const path = require('path');
3+
const { execSync } = require('child_process');
4+
5+
function resolveNpmVersion(pkgName, versionRange) {
6+
const spec = `${pkgName}@${versionRange}`;
7+
try {
8+
const rawOutput = execSync(`npm view "${spec}" version --json`, {
9+
encoding: 'utf8',
10+
stdio: ['ignore', 'pipe', 'pipe'],
11+
}).trim();
12+
13+
if (!rawOutput) {
14+
return null;
15+
}
16+
17+
const parsed = JSON.parse(rawOutput);
18+
if (Array.isArray(parsed)) {
19+
return parsed[parsed.length - 1];
20+
}
21+
22+
return parsed;
23+
} catch {
24+
return null;
25+
}
26+
}
27+
28+
function toRange(version) {
29+
return version.includes('x') ? version : `${version}.x`;
30+
}
31+
32+
const compatibilityPath = path.join(
33+
__dirname,
34+
'..',
35+
'..',
36+
'..',
37+
'packages',
38+
'react-native-reanimated',
39+
'compatibility.json'
40+
);
41+
42+
const workletsCompatibilityPath = path.join(
43+
__dirname,
44+
'..',
45+
'..',
46+
'..',
47+
'packages',
48+
'react-native-worklets',
49+
'compatibility.json'
50+
);
51+
52+
const compatibilityData = JSON.parse(
53+
fs.readFileSync(compatibilityPath, 'utf8')
54+
);
55+
const workletsCompatibilityData = JSON.parse(
56+
fs.readFileSync(workletsCompatibilityPath, 'utf8')
57+
);
58+
59+
const fabricCompatibility = compatibilityData.fabric;
60+
const matrixEntries = [];
61+
62+
for (const [reanimatedRange, details] of Object.entries(fabricCompatibility)) {
63+
if (reanimatedRange === 'nightly') {
64+
continue;
65+
}
66+
67+
const workletsRanges = details['react-native-worklets'];
68+
const reactNativeVersions = details['react-native'] || [];
69+
70+
if (!Array.isArray(workletsRanges) || workletsRanges.length === 0) {
71+
continue;
72+
}
73+
74+
if (reactNativeVersions.length === 0) {
75+
continue;
76+
}
77+
78+
const reanimatedNpmRange = toRange(reanimatedRange);
79+
const resolvedReanimatedVersion = resolveNpmVersion(
80+
'react-native-reanimated',
81+
reanimatedNpmRange
82+
);
83+
84+
if (!resolvedReanimatedVersion) {
85+
continue;
86+
}
87+
88+
for (const workletsRange of workletsRanges) {
89+
const workletsDetails = workletsCompatibilityData[workletsRange];
90+
const workletsReactNativeVersions = workletsDetails?.['react-native'] || [];
91+
92+
if (workletsReactNativeVersions.length === 0) {
93+
continue;
94+
}
95+
96+
const commonReactNativeVersions = reactNativeVersions.filter((version) =>
97+
workletsReactNativeVersions.includes(version)
98+
);
99+
100+
if (commonReactNativeVersions.length === 0) {
101+
continue;
102+
}
103+
104+
const workletsNpmRange = toRange(workletsRange);
105+
const resolvedWorkletsVersion = resolveNpmVersion(
106+
'react-native-worklets',
107+
workletsNpmRange
108+
);
109+
110+
if (!resolvedWorkletsVersion) {
111+
continue;
112+
}
113+
114+
for (const rnMinor of commonReactNativeVersions) {
115+
const reactNativeRange = toRange(rnMinor);
116+
const resolvedReactNativeVersion = resolveNpmVersion(
117+
'react-native',
118+
reactNativeRange
119+
);
120+
121+
if (!resolvedReactNativeVersion) {
122+
continue;
123+
}
124+
125+
matrixEntries.push({
126+
reactNativeVersion: resolvedReactNativeVersion,
127+
reanimatedVersion: resolvedReanimatedVersion,
128+
workletsVersion: resolvedWorkletsVersion,
129+
});
130+
}
131+
}
132+
}
133+
134+
const uniqueEntries = new Map();
135+
for (const entry of matrixEntries) {
136+
const key = `${entry.reactNativeVersion}-${entry.reanimatedVersion}-${entry.workletsVersion}`;
137+
uniqueEntries.set(key, entry);
138+
}
139+
140+
const matrix = Array.from(uniqueEntries.values());
141+
142+
fs.writeFileSync(
143+
'/tmp/reanimated-worklets-matrix.json',
144+
JSON.stringify(matrix)
145+
);

.github/workflows/lint-clang-tidy.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
- main
88
paths:
99
- '.github/workflows/lint-clang-tidy.yml'
10+
- 'scripts/clang-tidy-lint.sh'
1011

1112
merge_group:
1213
branches:
@@ -15,6 +16,7 @@ on:
1516
pull_request:
1617
paths:
1718
- '.github/workflows/lint-clang-tidy.yml'
19+
- 'scripts/clang-tidy-lint.sh'
1820
workflow_call:
1921
workflow_dispatch:
2022

@@ -30,12 +32,9 @@ jobs:
3032

3133
- name: Install monorepo node dependencies
3234
run: yarn install --immutable
33-
- name: Build Worklets package
34-
run: yarn workspace react-native-worklets build
35-
- name: Build Reanimated package
36-
run: yarn workspace react-native-reanimated build
3735

3836
- name: Clang-tidy lint Worklets
3937
run: yarn workspace react-native-worklets lint:clang-tidy
38+
4039
- name: Clang-tidy lint Reanimated
4140
run: yarn workspace react-native-reanimated lint:clang-tidy

.github/workflows/reanimated-static-checks.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ jobs:
4040
run: yarn build
4141

4242
# Checks
43+
- name: Validate peer dependency versions
44+
working-directory: ${{ env.PACKAGE_PATH }}
45+
run: yarn validate-peers
4346
- name: Check TypeScript types
4447
working-directory: ${{ env.PACKAGE_PATH }}
4548
run: yarn type:check

0 commit comments

Comments
 (0)