Skip to content

Commit 93831bd

Browse files
committed
Change default entrypoint of firebase-functions to v2.
1 parent 6d731d0 commit 93831bd

File tree

22 files changed

+833
-16
lines changed

22 files changed

+833
-16
lines changed

.firebaserc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"projects": {
3+
"default": "danielylee-test-1"
4+
}
5+
}

1

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
Merge branch 'master' of https://github.com/firebase/firebase-functions into launch.next
2+
3+
# Conflicts:
4+
# CHANGELOG.md
5+
#
6+
# It looks like you may be committing a merge.
7+
# If this is not correct, please run
8+
# git update-ref -d MERGE_HEAD
9+
# and try again.
10+
11+
12+
# Please enter the commit message for your changes. Lines starting
13+
# with '#' will be ignored, and an empty message aborts the commit.
14+
#
15+
# On branch launch.next
16+
# Your branch is up to date with 'origin/launch.next'.
17+
#
18+
# All conflicts fixed but you are still merging.
19+
#
20+
# Changes to be committed:
21+
# modified: CHANGELOG.md
22+
# modified: package-lock.json
23+
# modified: package.json
24+
#
25+
# Untracked files:
26+
# .firebaserc
27+
# 9.8.0
28+
# cloudbuild.yaml
29+
# firebase-functions-3.15.7.tgz.old
30+
# firebase.json
31+
# firestore-debug.log
32+
# integration_test/functions/firebase-debug.log
33+
# integration_test/functions/src/firebase-debug.log
34+
# tsdoc-metadata.json
35+
# ui-debug.log
36+
#

9.8.0

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
updated 1 package and audited 577 packages in 7.046s
3+
4+
20 packages are looking for funding
5+
run `npm fund` for details
6+
7+
found 22 vulnerabilities (2 moderate, 19 high, 1 critical)
8+
run `npm audit fix` to fix them, or `npm audit` for details

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,15 @@ _Please avoid double posting across multiple channels!_
2323

2424
```js
2525
// functions/index.js
26-
const functions = require("firebase-functions");
26+
const {onValueCreated} = require("firebase-functions/database");
27+
const logger = require("firebase-functions/logger");
2728
const notifyUsers = require("./notify-users");
2829

29-
exports.newPost = functions.database.ref("/posts/{postId}").onCreate((snapshot, context) => {
30-
functions.logger.info("Received new post with ID:", context.params.postId);
31-
return notifyUsers(snapshot.val());
30+
exports.newPost = onValueCreated(
31+
{ ref: "/posts/{postId}" },
32+
(event) => {
33+
logger.info("Received new post with ID:", event.params.postId);
34+
return notifyUsers(event.data.val());
3235
});
3336
```
3437

docgen/api-documenter.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-documenter.schema.json",
3+
"showInheritedMembers": true
4+
}

firebase-functions-3.15.7.tgz.old

66.8 KB
Binary file not shown.

firebase.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"emulators": {
3+
"functions": {
4+
"port": 5001
5+
},
6+
"firestore": {
7+
"port": 8080
8+
},
9+
"ui": {
10+
"enabled": true
11+
}
12+
}
13+
}

firestore-debug.log

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Mar 30, 2022 5:28:44 PM com.google.cloud.datastore.emulator.firestore.websocket.WebSocketServer start
2+
INFO: Started WebSocket server on ws://localhost:52536
3+
API endpoint: http://localhost:8080
4+
If you are using a library that supports the FIRESTORE_EMULATOR_HOST environment variable, run:
5+
6+
export FIRESTORE_EMULATOR_HOST=localhost:8080
7+
8+
Dev App Server is now running.
9+
10+
*** shutting down gRPC server since JVM is shutting down
11+
*** server shut down
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[debug] [2022-07-25T23:29:13.949Z] ----------------------------------------------------------------------
2+
[debug] [2022-07-25T23:29:13.950Z] Command: /Users/danielylee/.nvm/versions/node/v16.14.0/bin/node /Users/danielylee/.nvm/versions/node/v16.14.0/bin/firebase login:ci
3+
[debug] [2022-07-25T23:29:13.950Z] CLI Version: 11.3.0
4+
[debug] [2022-07-25T23:29:13.950Z] Platform: darwin
5+
[debug] [2022-07-25T23:29:13.950Z] Node Version: v16.14.0
6+
[debug] [2022-07-25T23:29:13.950Z] Time: Mon Jul 25 2022 16:29:13 GMT-0700 (Pacific Daylight Time)
7+
[debug] [2022-07-25T23:29:13.950Z] ----------------------------------------------------------------------
8+
[debug]
9+
[info]
10+
[info] Visit this URL on this device to log in:
11+
[info] https://accounts.google.com/o/oauth2/auth?client_id=563584335869-fgrhgmd47bqnekij5i8b5pr03ho849e6.apps.googleusercontent.com&scope=email%20openid%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloudplatformprojects.readonly%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Ffirebase%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform&response_type=code&state=628386933&redirect_uri=http%3A%2F%2Flocalhost%3A9005
12+
[info]
13+
[info] Waiting for authentication...

integration_test/run_tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ build_sdk
9393
delete_all_functions
9494

9595
for version in 14 16; do
96-
create_package_json $TIMESTAMP $version "^10.0.0"
96+
create_package_json $TIMESTAMP $version "^12.0.0"
9797
install_deps
9898
announce "Re-deploying the same functions to Node $version runtime ..."
9999
deploy

0 commit comments

Comments
 (0)