Skip to content

Commit

Permalink
Merge pull request #17
Browse files Browse the repository at this point in the history
dart2_3
  • Loading branch information
alextekartik authored May 16, 2023
2 parents 88d730d + fa6efde commit 4522536
Show file tree
Hide file tree
Showing 21 changed files with 115 additions and 130 deletions.
11 changes: 0 additions & 11 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion auth_node/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 0.9.1
publish_to: none

environment:
sdk: '>=2.18.0 <3.0.0'
sdk: '>=2.18.0 <4.0.0'

dependencies:
collection: '>=1.14.10'
Expand Down
2 changes: 1 addition & 1 deletion firebase_node/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ publish_to: none
#author: alex <[email protected]>

environment:
sdk: '>=2.18.0 <3.0.0'
sdk: '>=2.18.0 <4.0.0'

dependencies:
collection: '>=1.14.10'
Expand Down
18 changes: 13 additions & 5 deletions firestore_node/lib/src/firestore_node.dart
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,14 @@ abstract class QueryMixin implements Query {
Query limit(int limit) => _wrapQuery(nativeInstance.limit(limit));

@override
Query orderBy(String key, {bool? descending}) =>
_wrapQuery(nativeInstance.orderBy(key, descending: descending == true));
Query orderBy(String key, {bool? descending}) {
if (key == firestoreNameFieldPath) {
return _wrapQuery(
nativeInstance.orderByKey(descending: descending == true));
}
return _wrapQuery(
nativeInstance.orderBy(key, descending: descending == true));
}

@override
QueryNode startAt({DocumentSnapshot? snapshot, List? values}) =>
Expand Down Expand Up @@ -217,7 +223,7 @@ abstract class QueryMixin implements Query {
}

@override
Stream<QuerySnapshot> onSnapshot() {
Stream<QuerySnapshot> onSnapshot({bool includeMetadataChanges = false}) {
var transformer = StreamTransformer.fromHandlers(handleData:
(node.QuerySnapshot nativeQuerySnapshot,
EventSink<QuerySnapshot> sink) {
Expand Down Expand Up @@ -442,7 +448,7 @@ class DocumentReferenceNode implements DocumentReference {
String get path => nativeInstance.path;

@override
Stream<DocumentSnapshot> onSnapshot() {
Stream<DocumentSnapshot> onSnapshot({bool includeMetadataChanges = false}) {
var transformer = StreamTransformer.fromHandlers(handleData:
(node.DocumentSnapshot nativeDocumentSnapshot,
EventSink<DocumentSnapshot> sink) {
Expand Down Expand Up @@ -470,7 +476,9 @@ class DocumentReferenceNode implements DocumentReference {
}
}

class DocumentSnapshotNode implements DocumentSnapshot {
class DocumentSnapshotNode
with DocumentSnapshotMixin
implements DocumentSnapshot {
final node.DocumentSnapshot nativeInstance;

DocumentSnapshotNode(this.nativeInstance);
Expand Down
4 changes: 2 additions & 2 deletions firestore_node/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 0.10.0
publish_to: none

environment:
sdk: '>=2.18.0 <3.0.0'
sdk: '>=2.18.0 <4.0.0'

dependencies:
collection: '>=1.14.10'
Expand Down Expand Up @@ -59,4 +59,4 @@ dependency_overrides:
# tekartik_firebase_firestore_test:
# path: ../../firebase_firestore.dart/firestore_test
# firebase_admin_interop:
# path: ../../../tekartikdev/firebase-admin-interop
# path: ../../../tekartikdev/firebase-admin-interop
12 changes: 0 additions & 12 deletions firestore_node/tool/travis.dart

This file was deleted.

3 changes: 3 additions & 0 deletions functions_node/bin/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ Future main() async {
firebaseFunctionsUniversal['thelloworldv2'] = firebaseFunctionsUniversalV2
.https
.onRequestV2(HttpsOptions(region: regionBelgium), helloWorld);
firebaseFunctionsUniversal['thelloworldcorsv2'] = firebaseFunctionsUniversalV2
.https
.onRequestV2(HttpsOptions(region: regionBelgium, cors: true), helloWorld);
await firebaseFunctionsUniversal.serve();
print('serving...');
}
Expand Down
2 changes: 2 additions & 0 deletions functions_node/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ targets:
- test/**
- node/**
- bin/**
- example/**
builders:
build_web_compilers|entrypoint:
generate_for:
- bin/**
- example/**
options:
compiler: dart2js

Expand Down
2 changes: 1 addition & 1 deletion functions_node/deploy/functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"main": "index.js",
"dependencies": {
"firebase-functions": "^4.1.1"
"firebase-functions": "^4.2.1"
},
"devDependencies": {
"firebase-functions-test": "^0.2.0"
Expand Down
11 changes: 11 additions & 0 deletions functions_node/example/client/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>test_menu_starter</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="packages/tekartik_browser_utils/img/favicon.png">
</head>
<body>
<script src="main.dart.js"></script>
</body>
</html>
52 changes: 52 additions & 0 deletions functions_node/example/client/main.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// ignore_for_file: depend_on_referenced_packages

import 'package:http/http.dart';
import 'package:tekartik_http/http.dart';
import 'package:tekartik_test_menu_browser/test_menu_universal.dart';

Future main(List<String> arguments) async {
await mainMenu(arguments, () {
item('io http hello v2', () async {
// This test cors on the web
var client = Client();
var result = await httpClientRead(
client,
httpMethodGet,
Uri.parse('http://localhost:4999/thelloworldv2'),
);
write('result: $result');
});
item('io http hello v2 cors', () async {
// This test cors on the web
var client = Client();
var result = await httpClientRead(
client,
httpMethodPost,
Uri.parse('http://localhost:4999/thelloworldcorsv2'),
);
write('result: $result');
});
item('local firebase http hello v2', () async {
// This test cors on the web
var client = Client();
var result = await httpClientRead(
client,
httpMethodGet,
Uri.parse(
'http://localhost:5000/tekartik-eu-dev/europe-west1/thelloworldv2'),
);
write('result: $result');
});
item('local firebase http hello v2 cors', () async {
// This test cors on the web
var client = Client();
var result = await httpClientRead(
client,
httpMethodPost,
Uri.parse(
'http://localhost:5000/tekartik-eu-dev/europe-west1/thelloworldcorsv2'),
);
write('result: $result');
});
});
}
14 changes: 14 additions & 0 deletions functions_node/example/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Index</title>
</head>
<body>
<ul>
<li>
<a href="client/index.html">client/index.html</a>
</li>
</ul>
</body>
</html>
4 changes: 3 additions & 1 deletion functions_node/lib/src/firebase_functions_https_node.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ class HttpsFunctionsNode
}

return HttpsFunctionNode(functions.implFunctions.https.onRequestV2(
impl.HttpsOptions(region: httpsOptions.region ?? httpsOptions.regions),
impl.HttpsOptions(
region: httpsOptions.region ?? httpsOptions.regions,
cors: httpsOptions.cors),
handleRequest));
}

Expand Down
13 changes: 9 additions & 4 deletions functions_node/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ publish_to: none
#author: alex <[email protected]>

environment:
sdk: '>=2.18.0 <3.0.0'
sdk: '>=2.18.0 <4.0.0'

dependencies:
tekartik_firebase_functions:
git:
url: https://github.com/tekartik/firebase_functions.dart
path: firebase_functions
ref: dart2_3
version: '>=0.4.0'
version: '>=0.4.1'
tekartik_firebase_functions_io:
git:
url: https://github.com/tekartik/firebase_functions.dart
path: firebase_functions_io
ref: dart2_3
version: '>=0.4.0'
version: '>=0.4.1'
tekartik_firebase_firestore_node:
git:
url: https://github.com/tekartik/firebase_node.dart
Expand Down Expand Up @@ -57,6 +57,12 @@ dependencies:
ref: dart2_3
version: '>=0.4.0'
dev_dependencies:
tekartik_test_menu_browser:
git:
url: https://github.com/tekartik/test_menu.dart
path: test_menu_browser
ref: dart2_3
version: '>=0.4.7'
tekartik_app_node_build:
git:
url: https://github.com/tekartik/app_node_utils.dart
Expand All @@ -71,7 +77,6 @@ dev_dependencies:
version: '>=0.3.0'
test: '>=1.2.0'
dev_test: '>=0.13.3+12'
grinder: any
tekartik_build_utils:
git:
url: https://github.com/tekartik/build_utils.dart
Expand Down
48 changes: 0 additions & 48 deletions functions_node/tool/grind.dart

This file was deleted.

19 changes: 0 additions & 19 deletions functions_node/tool/travis.dart

This file was deleted.

2 changes: 1 addition & 1 deletion pubsub_node/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 0.2.0
publish_to: none

environment:
sdk: '>=2.18.0 <3.0.0'
sdk: '>=2.18.0 <4.0.0'

dependencies:
js: '>=0.6.1+1'
Expand Down
2 changes: 1 addition & 1 deletion repo_support/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 0.2.0
publish_to: none

environment:
sdk: '>=2.18.0 <3.0.0'
sdk: '>=2.18.0 <4.0.0'

dev_dependencies:
path:
Expand Down
2 changes: 1 addition & 1 deletion storage_node/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ publish_to: none
#author: alex <[email protected]>

environment:
sdk: '>=2.18.0 <3.0.0'
sdk: '>=2.18.0 <4.0.0'

dependencies:
path:
Expand Down
12 changes: 0 additions & 12 deletions storage_node/tool/travis.dart

This file was deleted.

10 changes: 0 additions & 10 deletions storage_node/tool/travis.sh

This file was deleted.

0 comments on commit 4522536

Please sign in to comment.