diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml index 062c5bc5..c5df48f7 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/ci-pr.yml @@ -21,6 +21,7 @@ jobs: mobile: ${{ steps.filter.outputs.mobile }} api: ${{ steps.filter.outputs.api }} admin: ${{ steps.filter.outputs.admin }} + config: ${{ steps.filter.outputs.config }} steps: - uses: actions/checkout@v5 - uses: dorny/paths-filter@v3 @@ -30,12 +31,20 @@ jobs: mobile: - 'apps/mobile/**' - 'packages/shared/**' + - 'bun.lock' api: - 'apps/api/**' - 'packages/shared/**' + - 'bun.lock' admin: - 'apps/admin/**' - 'packages/shared/**' + - 'bun.lock' + config: + - 'bun.lock' + - 'apps/mobile/package.json' + - 'apps/mobile/metro.config.js' + - 'apps/mobile/babel.config.js' format: runs-on: ubuntu-latest @@ -71,6 +80,9 @@ jobs: run: make doctor-diff BASE=origin/${{ github.event.pull_request.base.ref }} - name: React Doctor (full scan — required) run: make doctor + - name: Verify Web Bundle (catch CJS interop bugs) + if: ${{ needs.changes.outputs.config == 'true' }} + run: make verify-web validate-api: needs: changes diff --git a/Makefile b/Makefile index d17d4df7..f3a9aee7 100644 --- a/Makefile +++ b/Makefile @@ -68,6 +68,11 @@ start-headless: ## Launch Expo dev server without interactive TTY dev-web: ## Launch Expo dev server for web cd apps/mobile && APP_VERSION_NAME="$(APP_VERSION_NAME)" bun run web +.PHONY: verify-web +verify-web: ## Build web bundle and execute it to verify CJS interop (catches circular dependencies) + cd apps/mobile && APP_VERSION_NAME="$(APP_VERSION_NAME)" bun expo export --platform web + node -e "require('fs').readdirSync('apps/mobile/dist/_expo/static/js/web').filter(f => f.endsWith('.js')).forEach(f => require('./apps/mobile/dist/_expo/static/js/web/' + f))" + .PHONY: dev-android dev-android: ## Launch Expo dev server for Android (Expo Go) cd apps/mobile && bun run android-dev @@ -129,7 +134,7 @@ expo-upgrade: ## Check recommended versions and upgrade Expo SDK packages echo "Installing: $$PKGSPECS"; \ cd "$$MOBILE" && bun add --minimum-release-age $$SECONDS $$PKGSPECS; \ echo "Re-checking recommended versions..."; \ - cd "$$ROOT" && PACKAGES=$$(cd "$$MOBILE" && npx expo install --check 2>&1 | \ + cd "$$ROOT" && PACKAGES=$$(cd "$$MOBILE" && APP_VERSION_NAME="$(APP_VERSION_NAME)" npx expo install --check 2>&1 | \ sed -n 's/ \([^ ]*\)@[^ ]* - expected version: ~\?\([^ ]*\)/\1@\2/p'); \ if [ -n "$$PACKAGES" ]; then \ echo "Upgrading: $$PACKAGES"; \