Skip to content

Commit aa40536

Browse files
committed
Merge remote-tracking branch 'upstream/main' into mtewani/add-angular-v20-support
2 parents aa94dd9 + 547d5b1 commit aa40536

File tree

20 files changed

+538
-452
lines changed

20 files changed

+538
-452
lines changed

.changeset/chubby-zebras-enjoy.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

.changeset/config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"commit": false,
55
"fixed": [],
66
"linked": [],
7-
"access": "restricted",
7+
"access": "public",
88
"baseBranch": "main",
99
"updateInternalDependencies": "patch",
10-
"ignore": []
10+
"ignore": ["example-*"]
1111
}

.changeset/proud-rice-vanish.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 11 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ concurrency:
1414
group: release
1515
cancel-in-progress: false
1616

17-
# Minimal permissions for security
17+
# Permissions: add id-token for OIDC; keep others for PRs
1818
permissions:
19+
id-token: write
1920
contents: write
2021
pull-requests: write
2122
issues: write
@@ -61,6 +62,7 @@ jobs:
6162
runs-on: ubuntu-latest
6263
timeout-minutes: 45
6364
needs: quality
65+
environment: publish
6466
steps:
6567
- name: Checkout
6668
uses: actions/checkout@v4
@@ -73,6 +75,9 @@ jobs:
7375
node-version: "20"
7476
registry-url: "https://registry.npmjs.org"
7577

78+
- name: Ensure npm >= 11.5.1 for OIDC
79+
run: npm i -g npm@^11.5.1
80+
7681
- name: Enable Corepack
7782
run: corepack enable
7883

@@ -92,6 +97,9 @@ jobs:
9297
9398
- name: Install dependencies
9499
run: pnpm install
100+
# If you have PRIVATE deps, uncomment and set a read-only token:
101+
# env:
102+
# NODE_AUTH_TOKEN: ${{ secrets.NPM_READ_TOKEN }}
95103

96104
- name: Cache Firebase emulators
97105
uses: actions/cache@v4
@@ -118,7 +126,6 @@ jobs:
118126
- name: Verify build outputs
119127
run: |
120128
echo "Checking build outputs..."
121-
# Check all packages for dist directories
122129
MISSING_BUILDS=""
123130
for PKG_DIR in packages/*; do
124131
if [ -d "$PKG_DIR" ] && [ -f "$PKG_DIR/package.json" ]; then
@@ -128,44 +135,23 @@ jobs:
128135
fi
129136
fi
130137
done
131-
132138
if [ -n "$MISSING_BUILDS" ]; then
133139
echo "❌ Build outputs missing for: $MISSING_BUILDS"
134140
exit 1
135141
fi
136-
137142
echo "✅ All build outputs verified"
138143
139-
- name: Validate changesets
140-
run: |
141-
set -e
142-
CHANGESET_FILES=$(find .changeset -name "*.md" -type f ! -name "README.md" 2>/dev/null || true)
143-
144-
if [ -z "$CHANGESET_FILES" ]; then
145-
echo "❌ No changesets found!"
146-
echo ""
147-
echo "Please create changesets locally with: pnpm changeset"
148-
echo "Changesets should be created during development, not during release."
149-
exit 1
150-
fi
151-
152-
CHANGESET_COUNT=$(echo "$CHANGESET_FILES" | wc -l | tr -d ' ')
153-
echo "✅ Found $CHANGESET_COUNT changeset(s):"
154-
echo "$CHANGESET_FILES" | while read -r file; do
155-
echo " - $(basename "$file")"
156-
done
157-
158144
- name: Create Release Pull Request or Publish
159145
if: ${{ !inputs.dry_run }}
160146
id: changesets
161147
uses: changesets/action@v1
162148
with:
163-
publish: pnpm release
149+
publish: pnpm release # runs: pnpm build && changeset publish
164150
commit: "chore: version packages"
165151
title: "chore: version packages"
166152
env:
167153
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
168-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
154+
# NPM_TOKEN removed – OIDC will be used automatically
169155

170156
- name: Dry Run - Show Changes
171157
if: ${{ inputs.dry_run }}
@@ -180,24 +166,17 @@ jobs:
180166
echo ""
181167
fi
182168
done
183-
184169
echo "📦 Version changes that would be applied:"
185-
# Configure git user for changeset version command
186170
git config user.name "github-actions[bot]"
187171
git config user.email "github-actions[bot]@users.noreply.github.com"
188-
189-
# Save current HEAD reference before making changes
190172
ORIGINAL_HEAD=$(git rev-parse HEAD)
191-
# Create a temporary branch for dry run with unique name
192173
FALLBACK_ID=${GITHUB_RUN_ID:-$RANDOM$RANDOM}
193174
TEMP_BRANCH="dry-run-temp-$FALLBACK_ID"
194175
git checkout -b "$TEMP_BRANCH"
195176
pnpm changeset version
196-
197177
echo ""
198178
echo "🔍 Changed files:"
199179
git diff --name-status "$ORIGINAL_HEAD"
200-
201180
echo ""
202181
echo "🔍 Package version changes:"
203182
VERSION_CHANGES=$(git diff "$ORIGINAL_HEAD" -- '**/package.json' | grep -E "^[+-]\s*\"version\"" || true)
@@ -206,10 +185,7 @@ jobs:
206185
else
207186
echo "$VERSION_CHANGES"
208187
fi
209-
210-
# Clean up
211188
git checkout -
212189
git branch -D "$TEMP_BRANCH"
213-
214190
echo ""
215191
echo "✅ Dry run completed successfully"
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Test React Package with Firebase v12
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [main]
7+
pull_request:
8+
branches: [main]
9+
paths:
10+
- "packages/react/**"
11+
- "dataconnect-sdk/**"
12+
- ".github/workflows/test-react-firebase-v12.yml"
13+
14+
jobs:
15+
test-react-v12:
16+
name: React Package - Firebase v12
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: "20"
27+
28+
- name: Enable Corepack
29+
run: corepack enable
30+
31+
- name: Install dependencies
32+
run: pnpm install
33+
34+
# IMPROVED: Use actions/setup-java instead of apt-get
35+
- name: Setup Java
36+
uses: actions/setup-java@v4
37+
with:
38+
distribution: "temurin"
39+
java-version: "17"
40+
41+
- name: Install Firebase CLI
42+
uses: nick-invision/retry@v3
43+
with:
44+
timeout_minutes: 10
45+
retry_wait_seconds: 60
46+
max_attempts: 3
47+
command: npm i -g firebase-tools@latest
48+
49+
- name: Update to Firebase v12
50+
run: |
51+
# Update root devDependencies to Firebase v12
52+
pnpm add -Dw firebase@^12.1.0
53+
54+
- name: Update Data Connect SDK for Firebase v12
55+
run: |
56+
# Manually update the generated SDK to support Firebase v12
57+
# This is temporary until Firebase CLI officially supports v12
58+
cd dataconnect-sdk/js/default-connector
59+
# Update the peer dependency to include v12
60+
npm pkg set 'peerDependencies.firebase=^12.1.0'
61+
cd ../../..
62+
63+
- name: Reinstall dependencies with v12
64+
run: |
65+
# Install with no-frozen-lockfile to allow dependency changes
66+
pnpm install --no-frozen-lockfile
67+
# Force React package to use Firebase v12
68+
cd packages/react
69+
pnpm add -D firebase@^12.1.0
70+
cd ../..
71+
72+
- name: Verify Firebase v12 is installed
73+
run: |
74+
cd packages/react
75+
pnpm ls firebase | grep -E "firebase.*12\." || (echo "Firebase v12 not found!" && exit 1)
76+
77+
- name: Build React package
78+
run: |
79+
cd packages/react
80+
pnpm build
81+
82+
- name: Run React package tests with emulator
83+
run: |
84+
# Run only React package tests with emulator
85+
firebase emulators:exec --project test-project "cd packages/react && pnpm test:ci"
86+
env:
87+
CI: true

0 commit comments

Comments
 (0)