Skip to content

feat: bump firebase versions in react package #198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 14 additions & 37 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,6 @@ jobs:
- name: Enable Corepack
run: corepack enable

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: pnpm install

Expand All @@ -76,20 +62,6 @@ jobs:
- name: Enable Corepack
run: corepack enable

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: pnpm install

Expand All @@ -101,6 +73,11 @@ jobs:
max_attempts: 3
command: npm i -g firebase-tools@14

- name: Regenerate DataConnect connector with Firebase 12
run: |
cd dataconnect
firebase dataconnect:sdk:generate

- name: Run tests with emulator
run: pnpm test:emulator

Expand All @@ -120,27 +97,27 @@ jobs:
fi
fi
done

if [ -n "$MISSING_BUILDS" ]; then
echo "❌ Build outputs missing for: $MISSING_BUILDS"
exit 1
fi

echo "✅ All build outputs verified"

- name: Validate changesets
run: |
set -e
CHANGESET_FILES=$(find .changeset -name "*.md" -type f ! -name "README.md" 2>/dev/null || true)

if [ -z "$CHANGESET_FILES" ]; then
echo "❌ No changesets found!"
echo ""
echo "Please create changesets locally with: pnpm changeset"
echo "Changesets should be created during development, not during release."
exit 1
fi

CHANGESET_COUNT=$(echo "$CHANGESET_FILES" | wc -l | tr -d ' ')
echo "✅ Found $CHANGESET_COUNT changeset(s):"
echo "$CHANGESET_FILES" | while read -r file; do
Expand Down Expand Up @@ -177,19 +154,19 @@ jobs:
# Configure git user for changeset version command
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

# Save current HEAD reference before making changes
ORIGINAL_HEAD=$(git rev-parse HEAD)
# Create a temporary branch for dry run with unique name
FALLBACK_ID=${GITHUB_RUN_ID:-$RANDOM$RANDOM}
TEMP_BRANCH="dry-run-temp-$FALLBACK_ID"
git checkout -b "$TEMP_BRANCH"
pnpm changeset version

echo ""
echo "🔍 Changed files:"
git diff --name-status "$ORIGINAL_HEAD"

echo ""
echo "🔍 Package version changes:"
VERSION_CHANGES=$(git diff "$ORIGINAL_HEAD" -- '**/package.json' | grep -E "^[+-]\s*\"version\"" || true)
Expand All @@ -198,10 +175,10 @@ jobs:
else
echo "$VERSION_CHANGES"
fi

# Clean up
git checkout -
git branch -D "$TEMP_BRANCH"

echo ""
echo "✅ Dry run completed successfully"
76 changes: 47 additions & 29 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,6 @@ jobs:
- name: Enable Corepack
run: corepack enable

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: pnpm install

Expand All @@ -69,20 +55,6 @@ jobs:
- name: Enable Corepack
run: corepack enable

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: pnpm install

Expand All @@ -94,6 +66,11 @@ jobs:
max_attempts: 3
command: npm i -g firebase-tools@14

- name: Regenerate DataConnect connector with Firebase 12
run: |
cd dataconnect
firebase dataconnect:sdk:generate

# Determine which packages have changed
- name: Determine changed packages
id: changes
Expand Down Expand Up @@ -122,7 +99,7 @@ jobs:
fi
fi
done

if [ -n "$MISSING_BUILDS" ]; then
echo "❌ Build outputs not found for: $MISSING_BUILDS"
exit 1
Expand All @@ -132,3 +109,44 @@ jobs:
# Run tests with emulator for changed packages
- name: Run tests with emulator
run: pnpm test:emulator

test-firebase12:
runs-on: ubuntu-latest
timeout-minutes: 30
needs: quality
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: "https://registry.npmjs.org"

- name: Enable Corepack
run: corepack enable

- name: Install dependencies
run: pnpm install

- name: Install Firebase CLI
uses: nick-invision/retry@v3
with:
timeout_minutes: 10
retry_wait_seconds: 60
max_attempts: 3
command: npm i -g firebase-tools@14

- name: Regenerate DataConnect connector with Firebase 12
run: |
cd dataconnect
firebase dataconnect:sdk:generate

# Build packages before testing
- name: Build packages
run: pnpm turbo build

# Run tests with Firebase 12
- name: Run tests with Firebase 12
run: pnpm test:firebase12
104 changes: 37 additions & 67 deletions dataconnect-sdk/js/default-connector/esm/index.esm.js
Original file line number Diff line number Diff line change
@@ -1,126 +1,96 @@
import {
executeMutation,
executeQuery,
mutationRef,
queryRef,
validateArgs,
} from "firebase/data-connect";
import { queryRef, executeQuery, mutationRef, executeMutation, validateArgs } from 'firebase/data-connect';

export const connectorConfig = {
connector: "default",
service: "tanstack-query-firebase",
location: "us-central1",
connector: 'default',
service: 'tanstack-query-firebase',
location: 'us-central1'
};

export const createMovieRef = (dcOrVars, vars) => {
const { dc: dcInstance, vars: inputVars } = validateArgs(
connectorConfig,
dcOrVars,
vars,
true,
);
const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true);
dcInstance._useGeneratedSdk();
return mutationRef(dcInstance, "CreateMovie", inputVars);
};
createMovieRef.operationName = "CreateMovie";
return mutationRef(dcInstance, 'CreateMovie', inputVars);
}
createMovieRef.operationName = 'CreateMovie';

export function createMovie(dcOrVars, vars) {
return executeMutation(createMovieRef(dcOrVars, vars));
}

export const upsertMovieRef = (dcOrVars, vars) => {
const { dc: dcInstance, vars: inputVars } = validateArgs(
connectorConfig,
dcOrVars,
vars,
true,
);
const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true);
dcInstance._useGeneratedSdk();
return mutationRef(dcInstance, "UpsertMovie", inputVars);
};
upsertMovieRef.operationName = "UpsertMovie";
return mutationRef(dcInstance, 'UpsertMovie', inputVars);
}
upsertMovieRef.operationName = 'UpsertMovie';

export function upsertMovie(dcOrVars, vars) {
return executeMutation(upsertMovieRef(dcOrVars, vars));
}

export const deleteMovieRef = (dcOrVars, vars) => {
const { dc: dcInstance, vars: inputVars } = validateArgs(
connectorConfig,
dcOrVars,
vars,
true,
);
const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true);
dcInstance._useGeneratedSdk();
return mutationRef(dcInstance, "DeleteMovie", inputVars);
};
deleteMovieRef.operationName = "DeleteMovie";
return mutationRef(dcInstance, 'DeleteMovie', inputVars);
}
deleteMovieRef.operationName = 'DeleteMovie';

export function deleteMovie(dcOrVars, vars) {
return executeMutation(deleteMovieRef(dcOrVars, vars));
}

export const addMetaRef = (dc) => {
const { dc: dcInstance } = validateArgs(connectorConfig, dc, undefined);
const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined);
dcInstance._useGeneratedSdk();
return mutationRef(dcInstance, "AddMeta");
};
addMetaRef.operationName = "AddMeta";
return mutationRef(dcInstance, 'AddMeta');
}
addMetaRef.operationName = 'AddMeta';

export function addMeta(dc) {
return executeMutation(addMetaRef(dc));
}

export const deleteMetaRef = (dcOrVars, vars) => {
const { dc: dcInstance, vars: inputVars } = validateArgs(
connectorConfig,
dcOrVars,
vars,
true,
);
const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true);
dcInstance._useGeneratedSdk();
return mutationRef(dcInstance, "DeleteMeta", inputVars);
};
deleteMetaRef.operationName = "DeleteMeta";
return mutationRef(dcInstance, 'DeleteMeta', inputVars);
}
deleteMetaRef.operationName = 'DeleteMeta';

export function deleteMeta(dcOrVars, vars) {
return executeMutation(deleteMetaRef(dcOrVars, vars));
}

export const listMoviesRef = (dc) => {
const { dc: dcInstance } = validateArgs(connectorConfig, dc, undefined);
const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined);
dcInstance._useGeneratedSdk();
return queryRef(dcInstance, "ListMovies");
};
listMoviesRef.operationName = "ListMovies";
return queryRef(dcInstance, 'ListMovies');
}
listMoviesRef.operationName = 'ListMovies';

export function listMovies(dc) {
return executeQuery(listMoviesRef(dc));
}

export const getMovieByIdRef = (dcOrVars, vars) => {
const { dc: dcInstance, vars: inputVars } = validateArgs(
connectorConfig,
dcOrVars,
vars,
true,
);
const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true);
dcInstance._useGeneratedSdk();
return queryRef(dcInstance, "GetMovieById", inputVars);
};
getMovieByIdRef.operationName = "GetMovieById";
return queryRef(dcInstance, 'GetMovieById', inputVars);
}
getMovieByIdRef.operationName = 'GetMovieById';

export function getMovieById(dcOrVars, vars) {
return executeQuery(getMovieByIdRef(dcOrVars, vars));
}

export const getMetaRef = (dc) => {
const { dc: dcInstance } = validateArgs(connectorConfig, dc, undefined);
const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined);
dcInstance._useGeneratedSdk();
return queryRef(dcInstance, "GetMeta");
};
getMetaRef.operationName = "GetMeta";
return queryRef(dcInstance, 'GetMeta');
}
getMetaRef.operationName = 'GetMeta';

export function getMeta(dc) {
return executeQuery(getMetaRef(dc));
}

4 changes: 1 addition & 3 deletions dataconnect-sdk/js/default-connector/esm/package.json
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
{
"type": "module"
}
{"type":"module"}
Loading
Loading