Skip to content

Conversation

@FleetAdmiralJakob
Copy link
Member

@FleetAdmiralJakob FleetAdmiralJakob commented Aug 24, 2025

Add build code etc.

Summary by CodeRabbit

  • Bug Fixes

    • Improved Android startup reliability by ensuring the core-splashscreen dependency is injected to prevent resource/linking errors.
  • Chores

    • Added CI job to build and upload an Android preview APK (runs after lint/format/typecheck; gated by EXPO_TOKEN).
    • Added an Expo config plugin entry and the devDependency @expo/config-plugins to support the injection.

Copilot AI review requested due to automatic review settings August 24, 2025 14:31
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 24, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Adds a GitHub Actions job to build and upload an Android APK (gated by EXPO_TOKEN), appends ./app.plugin.js to expo.plugins in app.json, introduces an Expo run-once config plugin that injects core-splashscreen into android/app/build.gradle, and adds @expo/config-plugins as a devDependency.

Changes

Cohort / File(s) Summary
CI/CD Workflow: Expo Android build
.github/workflows/expo-build.yml
Adds a job depending on lint, format, and typecheck; exposes EXPO_TOKEN from secrets; sets up Node v20 and pnpm v10.12.1; installs deps; conditionally runs pnpm dlx eas-cli@latest build and build:download for Android (profile preview) when EXPO_TOKEN is set; uploads ./app.apk via actions/upload-artifact.
Expo App Config
app.json
Appends "./app.plugin.js" to the expo.plugins array (no other plugin changes).
Expo Config Plugin: Gradle dependency injection
app.plugin.js
Adds a RunOnce Expo config plugin (with-core-splashscreen-dependency) that ensures implementation("androidx.core:core-splashscreen:1.0.1") and implementation(project(":expo")) exist in the dependencies {} block of android/app/build.gradle; uses withAppBuildGradle, regex-based insertion, warns via WarningAggregator.addWarningAndroid on errors, and exports via createRunOncePlugin(..., 'with-core-splashscreen-dependency', '1.0.0').
Dev dependencies
package.json
Adds devDependency @expo/config-plugins ^7.9.2.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Dev as Developer
  participant GH as GitHub Actions
  participant Jobs as Workflow Jobs
  participant EAS as EAS CLI
  participant Art as Artifact Storage

  Dev->>GH: Push / PR triggers workflow
  GH->>Jobs: Run lint, format, typecheck
  Jobs->>Jobs: Setup Node v20, pnpm v10.12.1, install deps

  alt EXPO_TOKEN present
    Jobs->>EAS: pnpm dlx eas-cli@latest build --platform android --profile preview --non-interactive --wait --clear-cache
    EAS-->>Jobs: Build completes (APK)
    Jobs->>EAS: pnpm dlx eas-cli@latest build:download --platform android --latest --profile preview -o ./app.apk
    Jobs->>Art: upload-artifact ./app.apk (android-apk)
  else EXPO_TOKEN missing
    Jobs-->>Jobs: Skip build/download/upload steps
  end
Loading
sequenceDiagram
  autonumber
  participant Expo as Expo Prebuild
  participant Plugin as with-core-splashscreen-dependency
  participant Gradle as android/app/build.gradle
  participant Warn as WarningAggregator

  Expo->>Plugin: Apply config plugin
  Plugin->>Gradle: Read modResults.contents
  alt dependency missing
    Plugin->>Gradle: Insert implementation("androidx.core:core-splashscreen:1.0.1") and expo aggregator line into dependencies{}
  else dependency present
    Plugin-->>Gradle: No change
  end
  Plugin-->>Expo: Return modified modResults
  Note right of Plugin: RunOnce ensures single injection
  alt error
    Plugin->>Warn: addWarningAndroid('core-splashscreen', message)
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

I thump my paws—new builds take flight,
A token hums, "APK tonight."
I nudge Gradle's nest just once, not twice,
Core splash springs in with one small splice.
CI hops on—artifacts gleam bright. 🥕✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch expo/ci-cd-no-2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a build job to the existing GitHub Actions workflow for building Android APK files using Expo Application Services (EAS). The build process is designed to run after the existing lint, format, and typecheck jobs complete successfully.

  • Adds a new build job that depends on successful completion of code quality checks
  • Implements Android APK building using EAS CLI with preview profile
  • Includes artifact upload functionality for the generated APK

Comment on lines +92 to +99
run: pnpm dlx eas-cli@latest --version
# No explicit login needed, Expo CLI uses EXPO_TOKEN env automatically
- name: Build Android APK
if: env.EXPO_TOKEN != ''
run: pnpm dlx eas-cli@latest build --platform android --non-interactive --profile preview --clear-cache --wait
- name: Download Android APK
if: env.EXPO_TOKEN != ''
run: pnpm dlx eas-cli@latest build:download --platform android --profile preview --latest --path ./app.apk
Copy link

Copilot AI Aug 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The EAS CLI version is not pinned, using '@latest' which could lead to unexpected behavior if breaking changes are introduced. Consider pinning to a specific version for reproducible builds.

Suggested change
run: pnpm dlx eas-cli@latest --version
# No explicit login needed, Expo CLI uses EXPO_TOKEN env automatically
- name: Build Android APK
if: env.EXPO_TOKEN != ''
run: pnpm dlx eas-cli@latest build --platform android --non-interactive --profile preview --clear-cache --wait
- name: Download Android APK
if: env.EXPO_TOKEN != ''
run: pnpm dlx eas-cli@latest build:download --platform android --profile preview --latest --path ./app.apk
run: pnpm dlx eas-cli@6.3.0 --version
# No explicit login needed, Expo CLI uses EXPO_TOKEN env automatically
- name: Build Android APK
if: env.EXPO_TOKEN != ''
run: pnpm dlx eas-cli@6.3.0 build --platform android --non-interactive --profile preview --clear-cache --wait
- name: Download Android APK
if: env.EXPO_TOKEN != ''
run: pnpm dlx eas-cli@6.3.0 build:download --platform android --profile preview --latest --path ./app.apk

Copilot uses AI. Check for mistakes.
Comment on lines +92 to +99
run: pnpm dlx eas-cli@latest --version
# No explicit login needed, Expo CLI uses EXPO_TOKEN env automatically
- name: Build Android APK
if: env.EXPO_TOKEN != ''
run: pnpm dlx eas-cli@latest build --platform android --non-interactive --profile preview --clear-cache --wait
- name: Download Android APK
if: env.EXPO_TOKEN != ''
run: pnpm dlx eas-cli@latest build:download --platform android --profile preview --latest --path ./app.apk
Copy link

Copilot AI Aug 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The EAS CLI version is not pinned, using '@latest' which could lead to unexpected behavior if breaking changes are introduced. Consider pinning to a specific version for reproducible builds.

Suggested change
run: pnpm dlx eas-cli@latest --version
# No explicit login needed, Expo CLI uses EXPO_TOKEN env automatically
- name: Build Android APK
if: env.EXPO_TOKEN != ''
run: pnpm dlx eas-cli@latest build --platform android --non-interactive --profile preview --clear-cache --wait
- name: Download Android APK
if: env.EXPO_TOKEN != ''
run: pnpm dlx eas-cli@latest build:download --platform android --profile preview --latest --path ./app.apk
run: pnpm dlx eas-cli@6.3.0 --version
# No explicit login needed, Expo CLI uses EXPO_TOKEN env automatically
- name: Build Android APK
if: env.EXPO_TOKEN != ''
run: pnpm dlx eas-cli@6.3.0 build --platform android --non-interactive --profile preview --clear-cache --wait
- name: Download Android APK
if: env.EXPO_TOKEN != ''
run: pnpm dlx eas-cli@6.3.0 build:download --platform android --profile preview --latest --path ./app.apk

Copilot uses AI. Check for mistakes.
Comment on lines +95 to +102
if: env.EXPO_TOKEN != ''
run: pnpm dlx eas-cli@latest build --platform android --non-interactive --profile preview --clear-cache --wait
- name: Download Android APK
if: env.EXPO_TOKEN != ''
run: pnpm dlx eas-cli@latest build:download --platform android --profile preview --latest --path ./app.apk
# ...existing code...
- name: Upload Android artifact
if: env.EXPO_TOKEN != ''
Copy link

Copilot AI Aug 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition 'env.EXPO_TOKEN != ''' is repeated three times. Consider using a job-level condition or extracting this to a reusable condition to reduce duplication.

Suggested change
if: env.EXPO_TOKEN != ''
run: pnpm dlx eas-cli@latest build --platform android --non-interactive --profile preview --clear-cache --wait
- name: Download Android APK
if: env.EXPO_TOKEN != ''
run: pnpm dlx eas-cli@latest build:download --platform android --profile preview --latest --path ./app.apk
# ...existing code...
- name: Upload Android artifact
if: env.EXPO_TOKEN != ''
run: pnpm dlx eas-cli@latest build --platform android --non-interactive --profile preview --clear-cache --wait
- name: Download Android APK
run: pnpm dlx eas-cli@latest build:download --platform android --profile preview --latest --path ./app.apk
# ...existing code...
- name: Upload Android artifact

Copilot uses AI. Check for mistakes.
Comment on lines +95 to +102
if: env.EXPO_TOKEN != ''
run: pnpm dlx eas-cli@latest build --platform android --non-interactive --profile preview --clear-cache --wait
- name: Download Android APK
if: env.EXPO_TOKEN != ''
run: pnpm dlx eas-cli@latest build:download --platform android --profile preview --latest --path ./app.apk
# ...existing code...
- name: Upload Android artifact
if: env.EXPO_TOKEN != ''
Copy link

Copilot AI Aug 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition 'env.EXPO_TOKEN != ''' is repeated three times. Consider using a job-level condition or extracting this to a reusable condition to reduce duplication.

Suggested change
if: env.EXPO_TOKEN != ''
run: pnpm dlx eas-cli@latest build --platform android --non-interactive --profile preview --clear-cache --wait
- name: Download Android APK
if: env.EXPO_TOKEN != ''
run: pnpm dlx eas-cli@latest build:download --platform android --profile preview --latest --path ./app.apk
# ...existing code...
- name: Upload Android artifact
if: env.EXPO_TOKEN != ''
if: env.HAS_EXPO_TOKEN == 'true'
run: pnpm dlx eas-cli@latest build --platform android --non-interactive --profile preview --clear-cache --wait
- name: Download Android APK
if: env.HAS_EXPO_TOKEN == 'true'
run: pnpm dlx eas-cli@latest build:download --platform android --profile preview --latest --path ./app.apk
# ...existing code...
- name: Upload Android artifact
if: env.HAS_EXPO_TOKEN == 'true'

Copilot uses AI. Check for mistakes.
Comment on lines +95 to +102
if: env.EXPO_TOKEN != ''
run: pnpm dlx eas-cli@latest build --platform android --non-interactive --profile preview --clear-cache --wait
- name: Download Android APK
if: env.EXPO_TOKEN != ''
run: pnpm dlx eas-cli@latest build:download --platform android --profile preview --latest --path ./app.apk
# ...existing code...
- name: Upload Android artifact
if: env.EXPO_TOKEN != ''
Copy link

Copilot AI Aug 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition 'env.EXPO_TOKEN != ''' is repeated three times. Consider using a job-level condition or extracting this to a reusable condition to reduce duplication.

Suggested change
if: env.EXPO_TOKEN != ''
run: pnpm dlx eas-cli@latest build --platform android --non-interactive --profile preview --clear-cache --wait
- name: Download Android APK
if: env.EXPO_TOKEN != ''
run: pnpm dlx eas-cli@latest build:download --platform android --profile preview --latest --path ./app.apk
# ...existing code...
- name: Upload Android artifact
if: env.EXPO_TOKEN != ''
run: pnpm dlx eas-cli@latest build --platform android --non-interactive --profile preview --clear-cache --wait
- name: Download Android APK
run: pnpm dlx eas-cli@latest build:download --platform android --profile preview --latest --path ./app.apk
# ...existing code...
- name: Upload Android artifact

Copilot uses AI. Check for mistakes.
@FleetAdmiralJakob FleetAdmiralJakob linked an issue Aug 24, 2025 that may be closed by this pull request
@FleetAdmiralJakob FleetAdmiralJakob mentioned this pull request Aug 24, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

♻️ Duplicate comments (1)
.github/workflows/expo-build.yml (1)

91-99: Pin EAS CLI for reproducible builds

Using @latest risks sudden breakages. Pin to a known-good version.

Apply this diff:

-      - name: Ensure EAS CLI available
-        run: pnpm dlx eas-cli@latest --version
+      - name: Ensure EAS CLI available
+        run: pnpm dlx eas-cli@6.3.0 --version
@@
-      - name: Build Android APK
+      - name: Build Android (capture build id)
         if: env.EXPO_TOKEN != ''
-        run: pnpm dlx eas-cli@latest build --platform android --non-interactive --profile preview --clear-cache --wait
+        id: eas_build
+        run: |
+          JSON=$(pnpm dlx eas-cli@6.3.0 build --platform android --non-interactive --profile preview --clear-cache --wait --json)
+          echo "$JSON" > eas-build.json
+          BID=$(echo "$JSON" | jq -r '.builds[0].id // .builds[0].buildId')
+          echo "BUILD_ID=$BID" >> "$GITHUB_OUTPUT"
@@
-      - name: Download Android APK
+      - name: Download Android artifact
         if: env.EXPO_TOKEN != ''
-        run: pnpm dlx eas-cli@latest build:download --platform android --profile preview --latest --path ./app.apk
+        run: pnpm dlx eas-cli@6.3.0 build:download --platform android --profile preview -i ${{ steps.eas_build.outputs.BUILD_ID }} --path ./app.aab
🧹 Nitpick comments (6)
app.json (1)

54-56: Optional: Guard against accidental inclusion in non-Android contexts

Not required, but you could early-return in the plugin when !config.modRequest.platform === 'android' to skip work on iOS/web.

.github/workflows/expo-build.yml (3)

73-90: Speed up jobs with PNPM cache

Enable Node’s pnpm cache to reduce install time across jobs.

Apply this diff in each job’s setup-node step:

       - name: Setup Node.js
         uses: actions/setup-node@v4
         with:
           node-version: 20
+          cache: 'pnpm'

73-90: Optional: Add a timeout to the build job

Prevent hung CI runs on long/queued builds.

   build:
-    runs-on: ubuntu-latest
+    runs-on: ubuntu-latest
+    timeout-minutes: 90

95-103: Reduce repeated conditions

You can gate the entire build job or define a reusable env flag to DRY the if: env.EXPO_TOKEN != '' checks.

-  build:
+  build:
     runs-on: ubuntu-latest
     needs: [lint, format, typecheck]
-    env:
-      EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
+    env:
+      EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
+      HAS_EXPO_TOKEN: ${{ secrets.EXPO_TOKEN != '' }}
@@
-      - name: Build Android (capture build id)
-        if: env.EXPO_TOKEN != ''
+      - name: Build Android (capture build id)
+        if: env.HAS_EXPO_TOKEN == 'true'
@@
-      - name: Download Android artifact
-        if: env.EXPO_TOKEN != ''
+      - name: Download Android artifact
+        if: env.HAS_EXPO_TOKEN == 'true'
@@
-      - name: Upload Android artifact
-        if: env.EXPO_TOKEN != ''
+      - name: Upload Android artifact
+        if: env.HAS_EXPO_TOKEN == 'true'
app.plugin.js (2)

12-23: Avoid shadowing the config identifier for readability

Rename the inner callback param so outer config isn’t shadowed.

-const withCoreSplashscreenDependency = (config) =>
-  withAppBuildGradle(config, (config) => {
+const withCoreSplashscreenDependency = (config) =>
+  withAppBuildGradle(config, (mod) => {
     try {
-      config.modResults.contents = ensureDependency(config.modResults.contents);
+      mod.modResults.contents = ensureDependency(mod.modResults.contents);
     } catch (e) {
       WarningAggregator.addWarningAndroid(
         'core-splashscreen',
         `Failed to add androidx.core:core-splashscreen dependency: ${e?.message ?? e}`
       );
     }
-    return config;
+    return mod;
   });

7-10: Edge case: missing dependencies block

If dependencies { } isn’t found (customized build.gradle), the replace no-ops. Consider guarding and warning explicitly.

 function ensureDependency(contents) {
-  if (DEP_REGEX.test(contents)) return contents;
-  return contents.replace(/dependencies\s*\{/m, (m) => `${m}\n    ${DEP_LINE}`);
+  if (DEP_REGEX.test(contents)) return contents;
+  if (!/dependencies\s*\{/m.test(contents)) {
+    WarningAggregator.addWarningAndroid('core-splashscreen', 'No dependencies { } block found in app/build.gradle');
+    return contents;
+  }
+  return contents.replace(/dependencies\s*\{/m, (m) => `${m}\n    ${DEP_LINE}`);
 }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between e38bf3d and 2f8371b.

📒 Files selected for processing (3)
  • .github/workflows/expo-build.yml (1 hunks)
  • app.json (1 hunks)
  • app.plugin.js (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: murtazanoori
PR: The-Creative-Programming-Group/finance-io#34
File: .github/workflows/expo-build.yml:10-13
Timestamp: 2025-08-09T18:13:32.225Z
Learning: In the finance-io repository's GitHub Actions workflows, the team prefers to keep the `id-token: write` permission even when not immediately needed, as a future-proofing measure for potential OIDC authentication adoption with Expo EAS builds.
🔇 Additional comments (4)
app.json (1)

54-56: Plugin registration LGTM

The custom plugin is correctly referenced and ordering after expo-splash-screen is fine.

.github/workflows/expo-build.yml (2)

10-13: Permissions match team preference

Keeping id-token: write aligns with the repo’s stated preference for future OIDC needs.


101-106: No changes needed: eas.json’s preview profile specifies android.buildType: "apk", so uploading app.apk as android-apk is correct.

app.plugin.js (1)

5-5: Retain the current dependency version
androidx.core:core-splashscreen 1.0.1 is already the latest stable release—no 1.1.x stable exists.

Likely an incorrect or invalid review comment.

Comment on lines +99 to +106
run: pnpm dlx eas-cli@latest build:download --platform android --profile preview --latest --path ./app.apk
# ...existing code...
- name: Upload Android artifact
if: env.EXPO_TOKEN != ''
uses: actions/upload-artifact@v4
with:
name: android-apk
path: ./app.apk
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Avoid --latest; tie download to the build you just triggered

--latest can fetch an unrelated artifact from another commit/branch. The previous diff captures BUILD_ID and downloads that exact build.

🤖 Prompt for AI Agents
.github/workflows/expo-build.yml lines 99-106: the workflow currently uses
`--latest` when running `eas-cli build:download`, which can retrieve an
unrelated artifact; change the command to download the exact build by using the
BUILD_ID captured earlier (e.g., replace `--latest` with `--id ${{ env.BUILD_ID
}}` or the equivalent environment variable you set), keeping the platform,
profile and path flags intact so the download step deterministically fetches the
build you just triggered.

Comment on lines 5 to 10
const DEP_LINE = 'implementation("androidx.core:core-splashscreen:1.0.1")';

function ensureDependency(contents) {
if (contents.includes(DEP_LINE)) return contents; // already present
return contents.replace(/dependencies\s*\{/m, (match) => `${match}\n ${DEP_LINE}`);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Make detection robust to avoid duplicate entries

Exact string match can miss alternative Gradle syntaxes or different versions, causing duplicate dependencies. Use a regex that matches both with/without parentheses and any version.

Apply this diff:

-const DEP_LINE = 'implementation("androidx.core:core-splashscreen:1.0.1")';
+const DEP_LINE = 'implementation("androidx.core:core-splashscreen:1.0.1")';
+const DEP_REGEX = /implementation\s*\(?["']androidx\.core:core-splashscreen:[^"']+["']\)?/;
@@
-function ensureDependency(contents) {
-  if (contents.includes(DEP_LINE)) return contents; // already present
-  return contents.replace(/dependencies\s*\{/m, (match) => `${match}\n    ${DEP_LINE}`);
-}
+function ensureDependency(contents) {
+  if (DEP_REGEX.test(contents)) return contents;
+  return contents.replace(/dependencies\s*\{/m, (m) => `${m}\n    ${DEP_LINE}`);
+}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const DEP_LINE = 'implementation("androidx.core:core-splashscreen:1.0.1")';
function ensureDependency(contents) {
if (contents.includes(DEP_LINE)) return contents; // already present
return contents.replace(/dependencies\s*\{/m, (match) => `${match}\n ${DEP_LINE}`);
}
const DEP_LINE = 'implementation("androidx.core:core-splashscreen:1.0.1")';
const DEP_REGEX = /implementation\s*\(?["']androidx\.core:core-splashscreen:[^"']+["']\)?/;
function ensureDependency(contents) {
if (DEP_REGEX.test(contents)) return contents;
return contents.replace(/dependencies\s*\{/m, (m) => `${m}\n ${DEP_LINE}`);
}

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (1)
app.plugin.js (1)

9-11: Make dependency detection robust; avoid dupes across Gradle syntaxes

Use regex for presence checks so we don’t re-insert if the line exists with single quotes, no parentheses, a different version, or different spacing. This also aligns with the earlier suggestion on this PR thread.

Apply:

 const DEP_LINE = 'implementation("androidx.core:core-splashscreen:1.0.1")';
 const EXPO_AGG_LINE = 'implementation(project(":expo"))';
+const DEP_REGEX = /implementation\s*\(?["']androidx\.core:core-splashscreen:[^"']+["']\)?/;
+const EXPO_AGG_REGEX = /implementation\s*\(?project\s*\(\s*['"]\:expo['"]\s*\)\s*\)?/;

 ...
-  if (!updated.includes(EXPO_AGG_LINE)) {
+  if (!EXPO_AGG_REGEX.test(updated)) {
     updated = updated.replace(
       /dependencies\s*\{/m,
       (match) => `${match}\n    ${EXPO_AGG_LINE}`,
     );
   }
   // Ensure the splashscreen dependency is present
-  if (!updated.includes(DEP_LINE)) {
+  if (!DEP_REGEX.test(updated)) {
     updated = updated.replace(
       /dependencies\s*\{/m,
       (match) => `${match}\n    ${DEP_LINE}`,
     );
   }

Also applies to: 26-33

🧹 Nitpick comments (3)
app.plugin.js (3)

37-57: Skip noisy warnings during introspection

EAS “read config” passes often run; prefer a no-op instead of warning spam when introspecting.

 const withCoreSplashscreenDependency = (config) =>
   withAppBuildGradle(config, (config) => {
-    try {
+    try {
+      if (config.modRequest?.introspect) {
+        return config; // avoid warnings during introspection
+      }
       const updated = ensureDependency(config.modResults?.contents)

9-11: Optional: unpin or centralize versioning

Consider driving the splashscreen version from a Gradle version catalog (libs.versions.toml) or a root ext to ease upgrades. Keeping 1.0.1 hardcoded is fine short-term.


18-25: Gate expo aggregator insertion
Skip inserting implementation(project(":expo")) unless android/settings.gradle(.kts) contains include(":expo"), for example by wrapping with withSettingsGradle and checking settings.modResults.contents before injecting, or expose an enableExpoAggregator option to opt-in.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 327dcd0 and 4dc9b8b.

📒 Files selected for processing (1)
  • app.plugin.js (1 hunks)
🔇 Additional comments (3)
app.plugin.js (3)

3-7: LGTM: Correct use of Expo config-plugin APIs

Imports are correct and minimal for this mod.


12-17: Guarding for missing gradle contents is good

Early return when gradle contents or dependencies block are absent prevents crashes during introspection.


59-64: Run-once wrapping looks good

Stable plugin id and version; export shape is correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add CI/CD

2 participants