diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 37fff0d..3a29ac1 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,32 +1,63 @@ -# Update PRs for every ecosystem in the repo. The cooldown matches .yarnrc.yml's npmMinimalAgeGate: -# a release is proposed only after it has been public for a week. +# One weekly pull request with every dependency update across all ecosystems, so CI runs once. +# Cooldown matches .yarnrc.yml's npmMinimalAgeGate: a release is proposed only after a week. version: 2 + +multi-ecosystem-groups: + all-dependencies: + schedule: + interval: weekly + labels: ["dependencies"] + updates: - package-ecosystem: npm directory: / - schedule: { interval: weekly } + patterns: ["*"] + multi-ecosystem-group: all-dependencies cooldown: { default-days: 7 } versioning-strategy: increase - groups: - react-native: - patterns: ["react-native", "@react-native/*", "@react-native-community/*", "react", "@types/react"] - expo: - patterns: ["expo", "expo-*", "@expo/*"] - tooling: - patterns: ["*"] + ignore: + # Pinned by React Native / Expo, which ship and test an exact set: these move together + # with a React Native or Expo SDK upgrade, never on their own. + - dependency-name: "react" + - dependency-name: "react-test-renderer" + - dependency-name: "@types/react" + update-types: ["version-update:semver-major", "version-update:semver-minor"] + - dependency-name: "react-native" + - dependency-name: "@react-native/*" + - dependency-name: "@react-native-community/cli*" + - dependency-name: "expo" + - dependency-name: "expo-*" + - dependency-name: "react-native-safe-area-context" + # Majors React Native's toolchain does not support yet: @react-native/eslint-config accepts + # ESLint 8–9, @react-native/babel-preset needs Babel 7, and Node types follow the Node we run + # (.nvmrc, 24). + - dependency-name: "eslint" + update-types: ["version-update:semver-major"] + - dependency-name: "@eslint/js" + update-types: ["version-update:semver-major"] + - dependency-name: "@babel/*" + update-types: ["version-update:semver-major"] + - dependency-name: "@types/node" + update-types: ["version-update:semver-major"] + - package-ecosystem: gradle - directory: /android - schedule: { interval: weekly } - cooldown: { default-days: 7 } - - package-ecosystem: gradle - directory: /tools/remote-compose-json - schedule: { interval: weekly } + directories: ["/android", "/tools/remote-compose-json"] + patterns: ["*"] + multi-ecosystem-group: all-dependencies cooldown: { default-days: 7 } + - package-ecosystem: bundler directory: /example - schedule: { interval: weekly } + patterns: ["*"] + multi-ecosystem-group: all-dependencies cooldown: { default-days: 7 } + ignore: + # cocoapods-core requires activesupport < 8 (see Gemfile and osv-scanner.toml). + - dependency-name: "activesupport" + update-types: ["version-update:semver-major"] + - package-ecosystem: github-actions directory: / - schedule: { interval: weekly } + patterns: ["*"] + multi-ecosystem-group: all-dependencies cooldown: { default-days: 7 } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2447d51..eba9b6a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,11 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +# Least privilege: every job, including ones running code from automated PRs, gets a read-only +# token unless it asks for more (supply-chain does, for the reusable OSV workflow). +permissions: + contents: read + jobs: lint: runs-on: ubuntu-latest @@ -64,11 +69,16 @@ jobs: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Gradle wrapper jars are Gradle's own + # Every gradle-wrapper.jar in the repo (including ones an automated PR changes) must match a + # checksum Gradle published, or the build stops before running it. + uses: gradle/actions/wrapper-validation@8da46b539cd8fe6ab27ca75128919a18d757604c # v6.4.1 + - name: Setup uses: ./.github/actions/setup - name: Install JDK - uses: actions/setup-java@d1374f8ac74474200d16ef8ecee22c7ae7a51880 # v6.3.0 + uses: actions/setup-java@77dd5b2ce225ea11469928ac317850245a74ae78 # v6.2.0 with: distribution: 'zulu' java-version: '17' @@ -128,7 +138,7 @@ jobs: - name: Install JDK if: env.turbo_cache_hit != 1 - uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0 + uses: actions/setup-java@77dd5b2ce225ea11469928ac317850245a74ae78 # v6.2.0 with: distribution: 'zulu' java-version: '17' diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index c61a118..4c5c5a6 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/android/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +# Official checksum from services.gradle.org: a tampered download fails before it runs. +distributionSha256Sum=2ab2958f2a1e51120c326cad6f385153bb11ee93b3c216c5fccebfdfbb7ec6cb distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip networkTimeout=10000 validateDistributionUrl=true diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 8f076fb..3e90cdc 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -57,7 +57,7 @@ PODS: - React-Core (0.88.1): - React-Core-prebuilt - React-Core/Default (= 0.88.1) - - React-Core-prebuilt (0.88.0): + - React-Core-prebuilt (0.88.1): - ReactNativeDependencies - React-Core/CoreModulesHeaders (0.88.1): - React-Core-prebuilt @@ -1812,7 +1812,7 @@ PODS: - React-perflogger (= 0.88.1) - React-utils (= 0.88.1) - ReactNativeDependencies - - ReactNativeDependencies (0.88.0) + - ReactNativeDependencies (0.88.1) - RemoteCompose (0.1.0): - hermes-engine - RCTRequired @@ -2129,7 +2129,7 @@ SPEC CHECKSUMS: React-bridging: 48b96b1b423710103381dd90478513fff84456c4 React-callinvoker: 8eb02682e7fc3ddc0e25a8d96eb5733c367436e8 React-Core: 4cce9d3d50bd1544f33379cde3ae22175f6a1bcb - React-Core-prebuilt: 0fd2555a42f40e7770ced1c7dfc5ee1dbfe041cd + React-Core-prebuilt: dbd0bf94bbe1a1714bd4e27bc4f1bf33c02bb7b3 React-CoreModules: c96f14c068269b233fcabc8add64963132a371a2 React-cxxreact: 2956b35d64e2e5594607d359df31454a999acbed React-cxxstableapi: 7019410c5d74d0a60cae97b5a636cd42017370a3 @@ -2196,7 +2196,7 @@ SPEC CHECKSUMS: ReactAppDependencyProvider: 2dbb2d65f3a487b8a69449f5b1b12b44656d2204 ReactCodegen: 3840312f5071bb6b953b35a029c5c6dcf06b435e ReactCommon: b63ce798b898ed77c6cfdeb80b18080161f52ed5 - ReactNativeDependencies: d3b7423ba1e52525e42085c8470109abde583d2e + ReactNativeDependencies: a5164c3ebbe90d992022b5d9cbabbf770a6d7d05 RemoteCompose: 7ae606dc4a2805e305f334a715624c3c314dc5c1 SocketRocket: 37aec555668fb852ec12e3c0de59a86ca58f0871 Yoga: d1c536142c5ff8ec8cd856ab2a7c227a1d875c8e diff --git a/tools/remote-compose-json/gradle/wrapper/gradle-wrapper.jar b/tools/remote-compose-json/gradle/wrapper/gradle-wrapper.jar index d997cfc..51cbd2a 100644 Binary files a/tools/remote-compose-json/gradle/wrapper/gradle-wrapper.jar and b/tools/remote-compose-json/gradle/wrapper/gradle-wrapper.jar differ diff --git a/tools/remote-compose-json/gradle/wrapper/gradle-wrapper.properties b/tools/remote-compose-json/gradle/wrapper/gradle-wrapper.properties index c61a118..3c32683 100644 --- a/tools/remote-compose-json/gradle/wrapper/gradle-wrapper.properties +++ b/tools/remote-compose-json/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,8 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip +# Official checksum from services.gradle.org: a tampered download fails before it runs. +distributionSha256Sum=0b00b0ffe07c4d4789c12d4935a44a7057d55774b7540bd4a3f76f336deb177a +distributionUrl=https\://services.gradle.org/distributions/gradle-9.9.0-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/tools/remote-compose-json/gradlew b/tools/remote-compose-json/gradlew index 739907d..249efbb 100755 --- a/tools/remote-compose-json/gradlew +++ b/tools/remote-compose-json/gradlew @@ -20,7 +20,7 @@ ############################################################################## # -# Gradle start up script for POSIX generated by Gradle. +# gradlew start up script for POSIX generated by Gradle. # # Important for running: # @@ -29,7 +29,7 @@ # bash, then to run this script, type that shell name before the whole # command line, like: # -# ksh Gradle +# ksh gradlew # # Busybox and similar reduced shells will NOT work, because this script # requires all of these POSIX shell features: @@ -57,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/2d6327017519d23b96af35865dc997fcb544fb40/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. diff --git a/tools/remote-compose-json/gradlew.bat b/tools/remote-compose-json/gradlew.bat index 4626b90..3185a43 100644 --- a/tools/remote-compose-json/gradlew.bat +++ b/tools/remote-compose-json/gradlew.bat @@ -1,8 +1,3 @@ -@REM Copyright (c) Meta Platforms, Inc. and affiliates. -@REM -@REM This source code is licensed under the MIT license found in the -@REM LICENSE file in the root directory of this source tree. - @rem @rem Copyright 2015 the original author or authors. @rem @@ -24,12 +19,39 @@ @if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem -@rem Gradle startup script for Windows +@rem gradlew startup script for Windows @rem @rem ########################################################################## -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +@rem Set local scope for the variables, and ensure extensions are enabled +setlocal EnableExtensions + +@rem Catch executions from older scripts and ensure they exit cleanly. +@rem This can be removed once we can be reasonably confident that few people +@rem will be migrating directly to this new wrapper. +goto afterSafetyNet +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +goto exitWithErrorLevel +:afterSafetyNet set DIRNAME=%~dp0 if "%DIRNAME%"=="" set DIRNAME=. @@ -50,13 +72,14 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. 1>&2 -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 +1>&2 echo. +1>&2 echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +1>&2 echo. +1>&2 echo Please set the JAVA_HOME variable in your environment to match the +1>&2 echo location of your Java installation. -goto fail +"%COMSPEC%" /c exit 1 +goto exitWithErrorLevel :findJavaFromJavaHome set JAVA_HOME=%JAVA_HOME:"=% @@ -64,35 +87,26 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. 1>&2 -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 +1>&2 echo. +1>&2 echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +1>&2 echo. +1>&2 echo Please set the JAVA_HOME variable in your environment to match the +1>&2 echo location of your Java installation. -goto fail +"%COMSPEC%" /c exit 1 +goto exitWithErrorLevel :execute @rem Setup the command line -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal +@rem Execute gradlew +@rem endlocal doesn't take effect until after the line is parsed and variables are expanded +@rem which allows us to clear the local environment before executing the java command +endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel & goto exitWithErrorLevel -:omega +@rem This label must not be changed. We rely on old scripts being able to jump to this point. +:exitWithErrorLevel +@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts +"%COMSPEC%" /c exit %ERRORLEVEL%