Skip to content

Commit c43ddd4

Browse files
authored
refactor: rename to google_cloud_firestore (#180)
1 parent 223cc57 commit c43ddd4

File tree

102 files changed

+104
-100
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+104
-100
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ jobs:
131131
- name: Run dart_firebase_admin tests with coverage
132132
run: ${{ github.workspace }}/scripts/coverage.sh
133133

134-
- name: Run googleapis_firestore tests with coverage
134+
- name: Run google_cloud_firestore tests with coverage
135135
run: ${{ github.workspace }}/scripts/firestore-coverage.sh
136136

137137
- name: Run googleapis_storage tests with coverage
@@ -141,14 +141,14 @@ jobs:
141141
run: |
142142
# Save individual package coverage files before merging
143143
cp coverage.lcov coverage_admin.lcov
144-
cp ../googleapis_firestore/coverage.lcov coverage_firestore.lcov
144+
cp ../google_cloud_firestore/coverage.lcov coverage_firestore.lcov
145145
cp ../googleapis_storage/coverage.lcov coverage_storage.lcov
146146
147147
# Merge coverage reports from all packages (relative to packages/dart_firebase_admin)
148148
# Only merge files that exist
149149
COVERAGE_FILES=""
150150
[ -f coverage.lcov ] && COVERAGE_FILES="$COVERAGE_FILES coverage.lcov"
151-
[ -f ../googleapis_firestore/coverage.lcov ] && COVERAGE_FILES="$COVERAGE_FILES ../googleapis_firestore/coverage.lcov"
151+
[ -f ../google_cloud_firestore/coverage.lcov ] && COVERAGE_FILES="$COVERAGE_FILES ../google_cloud_firestore/coverage.lcov"
152152
[ -f ../googleapis_storage/coverage.lcov ] && COVERAGE_FILES="$COVERAGE_FILES ../googleapis_storage/coverage.lcov"
153153
154154
if [ -n "$COVERAGE_FILES" ]; then
@@ -219,7 +219,7 @@ jobs:
219219
# Console output
220220
echo "=== Coverage Report ==="
221221
echo "dart_firebase_admin: ${ADMIN_PCT}% (${ADMIN_HIT}/${ADMIN_TOTAL} lines)"
222-
echo "googleapis_firestore: ${FIRESTORE_PCT}% (${FIRESTORE_HIT}/${FIRESTORE_TOTAL} lines)"
222+
echo "google_cloud_firestore: ${FIRESTORE_PCT}% (${FIRESTORE_HIT}/${FIRESTORE_TOTAL} lines)"
223223
echo "googleapis_storage: ${STORAGE_PCT}% (${STORAGE_HIT}/${STORAGE_TOTAL} lines)"
224224
echo "----------------------"
225225
echo "Total: ${COVERAGE_PCT}% (${HIT_LINES}/${TOTAL_LINES} lines)"
@@ -256,7 +256,7 @@ jobs:
256256
| Package | Coverage |
257257
|---------|----------|
258258
| dart_firebase_admin | ${adminCov}% |
259-
| googleapis_firestore | ${firestoreCov}% |
259+
| google_cloud_firestore | ${firestoreCov}% |
260260
| googleapis_storage | ${storageCov}% |
261261
262262
_Minimum threshold: 40%_`;

doc/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ <h2>dart_firebase_admin</h2>
6161
</li>
6262

6363
<li class="package-item">
64-
<h2>googleapis_firestore</h2>
64+
<h2>google_cloud_firestore</h2>
6565
<p>Standalone Cloud Firestore client library for Dart. Provides direct access to Firestore database operations including documents, collections, queries, transactions, and batch writes.</p>
66-
<a href="api/googleapis_firestore/index.html">View Documentation →</a>
66+
<a href="api/google_cloud_firestore/index.html">View Documentation →</a>
6767
</li>
6868

6969
<li class="package-item">

packages/dart_firebase_admin/README.md

Lines changed: 2 additions & 2 deletions

packages/dart_firebase_admin/example/lib/firestore_example.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import 'dart:async';
22
import 'package:dart_firebase_admin/dart_firebase_admin.dart';
3-
import 'package:googleapis_firestore/googleapis_firestore.dart';
3+
import 'package:google_cloud_firestore/google_cloud_firestore.dart';
44

55
/// Main entry point for all Firestore examples
66
Future<void> firestoreExample(FirebaseApp admin) async {

packages/dart_firebase_admin/example/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ environment:
66

77
dependencies:
88
dart_firebase_admin: ^0.1.0
9-
googleapis_firestore: ^0.1.0
9+
google_cloud_firestore: ^0.1.0
1010
googleapis_storage: ^0.1.0
1111

1212
dependency_overrides:
1313
dart_firebase_admin:
1414
path: ../../dart_firebase_admin
15-
googleapis_firestore:
16-
path: ../../googleapis_firestore
15+
google_cloud_firestore:
16+
path: ../../google_cloud_firestore
1717
googleapis_storage:
1818
path: ../../googleapis_storage
1919

packages/dart_firebase_admin/lib/src/app.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import 'dart:typed_data';
88
import 'package:equatable/equatable.dart';
99
import 'package:google_cloud/constants.dart' as google_cloud;
1010
import 'package:google_cloud/google_cloud.dart' as google_cloud;
11+
import 'package:google_cloud_firestore/google_cloud_firestore.dart'
12+
as google_cloud_firestore;
1113
import 'package:googleapis/identitytoolkit/v3.dart' as auth3;
1214
import 'package:googleapis_auth/auth_io.dart' as googleapis_auth;
13-
import 'package:googleapis_firestore/googleapis_firestore.dart'
14-
as googleapis_firestore;
1515
import 'package:http/http.dart';
1616
import 'package:meta/meta.dart';
1717

@@ -33,5 +33,5 @@ part 'app/emulator_client.dart';
3333
part 'app/environment.dart';
3434
part 'app/exception.dart';
3535
part 'app/firebase_app.dart';
36-
part 'app/firebase_user_agent_client.dart';
3736
part 'app/firebase_service.dart';
37+
part 'app/firebase_user_agent_client.dart';

packages/dart_firebase_admin/lib/src/app/firebase_app.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ class FirebaseApp {
193193
///
194194
/// For multi-database support, use [databaseId] to specify a named database.
195195
/// Default is '(default)'.
196-
googleapis_firestore.Firestore firestore({
197-
googleapis_firestore.Settings? settings,
196+
google_cloud_firestore.Firestore firestore({
197+
google_cloud_firestore.Settings? settings,
198198
String databaseId = kDefaultDatabaseId,
199199
}) {
200200
final service = Firestore.internal(this);

packages/dart_firebase_admin/lib/src/firestore/firestore.dart

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import 'dart:async';
22

3-
import 'package:googleapis_firestore/googleapis_firestore.dart'
4-
as googleapis_firestore;
3+
import 'package:google_cloud_firestore/google_cloud_firestore.dart'
4+
as google_cloud_firestore;
55
import 'package:meta/meta.dart';
66

77
import '../app.dart';
@@ -27,17 +27,17 @@ class Firestore implements FirebaseService {
2727
final FirebaseApp app;
2828

2929
// Maps database IDs to Firestore delegate instances
30-
final Map<String, googleapis_firestore.Firestore> _databases = {};
30+
final Map<String, google_cloud_firestore.Firestore> _databases = {};
3131

3232
// Maps database IDs to their settings
33-
final Map<String, googleapis_firestore.Settings?> _settings = {};
33+
final Map<String, google_cloud_firestore.Settings?> _settings = {};
3434

3535
/// Gets the settings used to initialize a specific database.
3636
/// Returns null if the database hasn't been initialized yet.
3737
///
3838
/// This is exposed for testing purposes to verify credential extraction.
3939
@visibleForTesting
40-
googleapis_firestore.Settings? getSettingsForDatabase(String databaseId) {
40+
google_cloud_firestore.Settings? getSettingsForDatabase(String databaseId) {
4141
return _settings[databaseId];
4242
}
4343

@@ -46,16 +46,16 @@ class Firestore implements FirebaseService {
4646
///
4747
/// This is exposed for testing purposes to verify settings construction.
4848
@visibleForTesting
49-
googleapis_firestore.Settings buildSettingsForTesting(
49+
google_cloud_firestore.Settings buildSettingsForTesting(
5050
String databaseId,
51-
googleapis_firestore.Settings? userSettings,
51+
google_cloud_firestore.Settings? userSettings,
5252
) {
5353
return _buildSettings(databaseId, userSettings);
5454
}
5555

5656
/// Gets or creates a Firestore instance for the specified database.
5757
@internal
58-
googleapis_firestore.Firestore getDatabase([
58+
google_cloud_firestore.Firestore getDatabase([
5959
String databaseId = kDefaultDatabaseId,
6060
]) {
6161
var database = _databases[databaseId];
@@ -70,9 +70,9 @@ class Firestore implements FirebaseService {
7070
/// Initializes a Firestore instance with specific settings.
7171
/// Throws if the database was already initialized with different settings.
7272
@internal
73-
googleapis_firestore.Firestore initializeDatabase(
73+
google_cloud_firestore.Firestore initializeDatabase(
7474
String databaseId,
75-
googleapis_firestore.Settings? settings,
75+
google_cloud_firestore.Settings? settings,
7676
) {
7777
final existingInstance = _databases[databaseId];
7878
if (existingInstance != null) {
@@ -99,27 +99,28 @@ class Firestore implements FirebaseService {
9999
}
100100

101101
/// Creates Firestore settings from the Firebase app configuration
102-
googleapis_firestore.Settings _buildSettings(
102+
google_cloud_firestore.Settings _buildSettings(
103103
String databaseId,
104-
googleapis_firestore.Settings? userSettings,
104+
google_cloud_firestore.Settings? userSettings,
105105
) {
106106
final projectId = app.projectId;
107107
final appCredential = app.options.credential;
108108

109-
var settings = userSettings ?? const googleapis_firestore.Settings();
109+
var settings = userSettings ?? const google_cloud_firestore.Settings();
110110

111111
if (settings.credential == null) {
112112
if (appCredential is ServiceAccountCredential) {
113113
settings = settings.copyWith(
114-
credential: googleapis_firestore.Credential.fromServiceAccountParams(
115-
email: appCredential.clientEmail,
116-
privateKey: appCredential.privateKey,
117-
projectId: appCredential.projectId,
118-
),
114+
credential:
115+
google_cloud_firestore.Credential.fromServiceAccountParams(
116+
email: appCredential.clientEmail,
117+
privateKey: appCredential.privateKey,
118+
projectId: appCredential.projectId,
119+
),
119120
);
120121
} else if (appCredential is ApplicationDefaultCredential) {
121122
settings = settings.copyWith(
122-
credential: googleapis_firestore
123+
credential: google_cloud_firestore
123124
.Credential.fromApplicationDefaultCredentials(),
124125
);
125126
} else if (appCredential != null) {
@@ -140,17 +141,17 @@ class Firestore implements FirebaseService {
140141
return settings;
141142
}
142143

143-
googleapis_firestore.Firestore _initFirestore(
144+
google_cloud_firestore.Firestore _initFirestore(
144145
String databaseId,
145-
googleapis_firestore.Settings? settings,
146+
google_cloud_firestore.Settings? settings,
146147
) {
147148
final firestoreSettings = _buildSettings(databaseId, settings);
148-
return googleapis_firestore.Firestore(settings: firestoreSettings);
149+
return google_cloud_firestore.Firestore(settings: firestoreSettings);
149150
}
150151

151152
bool _areSettingsEqual(
152-
googleapis_firestore.Settings? a,
153-
googleapis_firestore.Settings? b,
153+
google_cloud_firestore.Settings? a,
154+
google_cloud_firestore.Settings? b,
154155
) {
155156
if (a == null && b == null) return true;
156157
if (a == null || b == null) return false;

packages/dart_firebase_admin/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ dependencies:
1515
dart_jsonwebtoken: ^3.0.0
1616
equatable: ^2.0.7
1717
google_cloud: ^0.3.0
18+
google_cloud_firestore: ^0.1.0
1819
googleapis: ^15.0.0
1920
googleapis_auth: ^2.1.0
2021
googleapis_beta: ^9.0.0
21-
googleapis_firestore: ^0.1.0
2222
googleapis_storage: ^0.1.0
2323
http: ^1.0.0
2424
intl: ^0.20.0

packages/dart_firebase_admin/test/app/firebase_app_test.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import 'package:dart_firebase_admin/src/app.dart';
77
import 'package:dart_firebase_admin/src/app_check/app_check.dart';
88
import 'package:dart_firebase_admin/src/auth.dart';
99
import 'package:dart_firebase_admin/storage.dart';
10-
import 'package:googleapis_firestore/googleapis_firestore.dart'
11-
as googleapis_firestore;
10+
import 'package:google_cloud_firestore/google_cloud_firestore.dart'
11+
as google_cloud_firestore;
1212
import 'package:mocktail/mocktail.dart';
1313
import 'package:test/test.dart';
1414

@@ -487,7 +487,7 @@ void main() {
487487

488488
test('firestore returns Firestore instance', () {
489489
final firestore = app.firestore(settings: mockFirestoreSettings);
490-
expect(firestore, isA<googleapis_firestore.Firestore>());
490+
expect(firestore, isA<google_cloud_firestore.Firestore>());
491491
// Verify we can use Firestore methods
492492
expect(firestore.collection('test'), isNotNull);
493493
});
@@ -516,7 +516,7 @@ void main() {
516516
test('firestore throws when reinitializing with different settings', () {
517517
// Initialize with first settings
518518
app.firestore(
519-
settings: const googleapis_firestore.Settings(
519+
settings: const google_cloud_firestore.Settings(
520520
host: 'localhost:8080',
521521
environmentOverride: {'FIRESTORE_EMULATOR_HOST': 'localhost:8080'},
522522
),
@@ -525,7 +525,7 @@ void main() {
525525
// Try to initialize again with different settings - should throw
526526
expect(
527527
() => app.firestore(
528-
settings: const googleapis_firestore.Settings(
528+
settings: const google_cloud_firestore.Settings(
529529
host: 'different:9090',
530530
environmentOverride: {
531531
'FIRESTORE_EMULATOR_HOST': 'localhost:8080',

0 commit comments

Comments
 (0)