chore(deps): firebase-admin 13 → 14 - #5851
Open
ToddHebebrand wants to merge 2 commits into
Open
ToddHebebrand wants to merge 2 commits into
ToddHebebrand wants to merge 2 commits into
Conversation
firebase-admin 14 removes the legacy admin.app/admin.messaging()/ admin.credential compat namespace from the package's default export entirely (confirmed via the shipped .d.ts — the root index only re-exports App/AppOptions/initializeApp/getApp/getApps/cert etc). This is a real break beyond the brief's error-code-matching concern: fcm.ts is rewritten from `import admin from 'firebase-admin'` / `admin.app()`/`admin.messaging()` to the modular `firebase-admin/app` (initializeApp, getApp, getApps, cert) and `firebase-admin/messaging` (getMessaging) subpath imports. Adds a test asserting sendFcmNotification still maps a real SDK FirebaseMessagingError (constructed via the runtime class shape, since the public .d.ts marks its constructor @internal) with code 'messaging/registration-token-not-registered' to {unregistered: true}. It passed unchanged on both 13 and 14 — the error-code contract itself didn't move, only the app/messaging accessor surface did. fcm.test.ts's mocks are updated to mock the 'firebase-admin/app' and 'firebase-admin/messaging' subpaths instead of the removed default namespace export. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018cms2ECUY322qubUH3PmVA
Deploying breeze with
|
| Latest commit: |
4cd6ba7
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c2ee847c.breeze-9te.pages.dev |
| Branch Preview URL: | https://chore-deps-firebase-admin-14.breeze-9te.pages.dev |
pnpm up firebase-admin@latest also re-resolved unrelated packages (yaml 2.9.0→2.9.1 re-keying astro/vite/tsup snapshot entries, joi, hono, compression). Regenerated pnpm-lock.yaml from origin/main via `pnpm install --lockfile-only` on top of the already-bumped package.json so only firebase-admin's own dependency graph moves. Remaining diff is legitimate transitive drift from the firebase-admin 14 bump itself: the full @google-cloud/* (firestore, storage, paginator, projectify, promisify), google-auth-library, google-gax, gaxios, gcp-metadata, protobufjs, teeny-request, retry-request, jwks-rsa, lru-memoizer and @grpc/proto-loader graph all moved to new majors — expected for a Firebase Admin SDK major version bump. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018cms2ECUY322qubUH3PmVA
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bumps
firebase-admin^13.7.0→^14.4.0inapps/api/package.json.firebase-admin 14 removes the legacy
admin.app/admin.messaging()/admin.credentialcompat namespace from the package's default export entirely — confirmed against the shipped.d.ts, whose root index only re-exportsApp,initializeApp,getApp,getApps,cert, etc. This is a real break beyond what the brief flagged (dead-token error-code matching);fcm.tsno longer typechecked at all against v14 with the oldimport admin from 'firebase-admin'style.Rewrote
apps/api/src/services/fcm.tsfrom the legacy namespace to the modular API:import admin from 'firebase-admin'→import { initializeApp, getApp, getApps, cert, type App, type ServiceAccount } from 'firebase-admin/app'+import { getMessaging } from 'firebase-admin/messaging'admin.apps.length/admin.app()/admin.initializeApp(...)/admin.credential.cert(...)/admin.messaging().send(...)→ their modular equivalents.fcm.test.ts'svi.mock('firebase-admin', ...)is replaced with mocks of the'firebase-admin/app'and'firebase-admin/messaging'subpaths (the latter spreadsimportOriginal()so the realFirebaseMessagingErrorclass stays available for the new test below).Why
Clears a major-version bump dependabot could not propose (docs/superpowers/plans/2026-09-14-dependency-major-upgrades.md).
Verification (brief step 2 — dead-token code assertion)
Added a test that constructs a real
FirebaseMessagingError(fromfirebase-admin/messaging, via its runtime constructor shape since the public.d.tsmarks the constructor@internal) with coderegistration-token-not-registered, rejectssend()with it, and assertssendFcmNotificationreturns{unregistered: true}. Ran it on 13 first (green — the class/constructor shape was already compatible pre-bump), then on 14 (green — the error-code contract itself didn't move, only the app/messaging accessor surface did).grep confirms
fcm.tsis the only production consumer offirebase-adminin the repo (one unrelated comment mention inquietHours.ts, no import).Lockfile drift
pnpm up firebase-admin@latestalso re-resolved unrelated packages (yaml 2.9.0→2.9.1, joi, hono, compression). Narrowed viagit checkout origin/main -- pnpm-lock.yaml && pnpm install --lockfile-onlyon top of the already-bumpedpackage.json:Output: empty. Remaining diff is entirely firebase-admin 14's own transitive graph moving to new majors — the full
@google-cloud/*(firestore, storage, paginator, projectify, promisify),google-auth-library,google-gax,gaxios,gcp-metadata,protobufjs,teeny-request,retry-request,jwks-rsa,lru-memoizer, and@grpc/proto-loader— expected for a Firebase Admin SDK major bump. Re-ran the full verification above against the narrowed lockfile (tsc + fcm test suite, both green).Concerns
🤖 Generated with Claude Code
https://claude.ai/code/session_018cms2ECUY322qubUH3PmVA