Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Change default entrypoint of firebase-functions to v2.
  • Loading branch information
taeold committed Aug 16, 2024
commit 93831bd4e4b080bd4263b587bf5ef8e66ec18949
5 changes: 5 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "danielylee-test-1"
}
}
36 changes: 36 additions & 0 deletions 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Merge branch 'master' of https://github.com/firebase/firebase-functions into launch.next

# Conflicts:
# CHANGELOG.md
#
# It looks like you may be committing a merge.
# If this is not correct, please run
# git update-ref -d MERGE_HEAD
# and try again.


# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch launch.next
# Your branch is up to date with 'origin/launch.next'.
#
# All conflicts fixed but you are still merging.
#
# Changes to be committed:
# modified: CHANGELOG.md
# modified: package-lock.json
# modified: package.json
#
# Untracked files:
# .firebaserc
# 9.8.0
# cloudbuild.yaml
# firebase-functions-3.15.7.tgz.old
# firebase.json
# firestore-debug.log
# integration_test/functions/firebase-debug.log
# integration_test/functions/src/firebase-debug.log
# tsdoc-metadata.json
# ui-debug.log
#
8 changes: 8 additions & 0 deletions 9.8.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
+ [email protected]
updated 1 package and audited 577 packages in 7.046s

20 packages are looking for funding
run `npm fund` for details

found 22 vulnerabilities (2 moderate, 19 high, 1 critical)
run `npm audit fix` to fix them, or `npm audit` for details
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@ _Please avoid double posting across multiple channels!_

```js
// functions/index.js
const functions = require("firebase-functions");
const {onValueCreated} = require("firebase-functions/database");
const logger = require("firebase-functions/logger");
const notifyUsers = require("./notify-users");

exports.newPost = functions.database.ref("/posts/{postId}").onCreate((snapshot, context) => {
functions.logger.info("Received new post with ID:", context.params.postId);
return notifyUsers(snapshot.val());
exports.newPost = onValueCreated(
{ ref: "/posts/{postId}" },
(event) => {
logger.info("Received new post with ID:", event.params.postId);
return notifyUsers(event.data.val());
});
```

Expand Down
4 changes: 4 additions & 0 deletions docgen/api-documenter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-documenter.schema.json",
"showInheritedMembers": true
}
Binary file added firebase-functions-3.15.7.tgz.old
Binary file not shown.
13 changes: 13 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"emulators": {
"functions": {
"port": 5001
},
"firestore": {
"port": 8080
},
"ui": {
"enabled": true
}
}
}
11 changes: 11 additions & 0 deletions firestore-debug.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Mar 30, 2022 5:28:44 PM com.google.cloud.datastore.emulator.firestore.websocket.WebSocketServer start
INFO: Started WebSocket server on ws://localhost:52536
API endpoint: http://localhost:8080
If you are using a library that supports the FIRESTORE_EMULATOR_HOST environment variable, run:

export FIRESTORE_EMULATOR_HOST=localhost:8080

Dev App Server is now running.

*** shutting down gRPC server since JVM is shutting down
*** server shut down
13 changes: 13 additions & 0 deletions integration_test/functions/src/firebase-debug.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[debug] [2022-07-25T23:29:13.949Z] ----------------------------------------------------------------------
[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
[debug] [2022-07-25T23:29:13.950Z] CLI Version: 11.3.0
[debug] [2022-07-25T23:29:13.950Z] Platform: darwin
[debug] [2022-07-25T23:29:13.950Z] Node Version: v16.14.0
[debug] [2022-07-25T23:29:13.950Z] Time: Mon Jul 25 2022 16:29:13 GMT-0700 (Pacific Daylight Time)
[debug] [2022-07-25T23:29:13.950Z] ----------------------------------------------------------------------
[debug]
[info]
[info] Visit this URL on this device to log in:
[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
[info]
[info] Waiting for authentication...
2 changes: 1 addition & 1 deletion integration_test/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ build_sdk
delete_all_functions

for version in 14 16; do
create_package_json $TIMESTAMP $version "^10.0.0"
create_package_json $TIMESTAMP $version "^12.0.0"
install_deps
announce "Re-deploying the same functions to Node $version runtime ..."
deploy
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
"lib",
"protos"
],
"main": "lib/v1/index.js",
"main": "lib/v2/index.js",
"bin": {
"firebase-functions": "./lib/bin/firebase-functions.js"
},
"types": "lib/v1/index.d.ts",
"types": "lib/v2/index.d.ts",
"exports": {
".": "./lib/v1/index.js",
".": "./lib/v2/index.js",
"./logger/compat": "./lib/logger/compat.js",
"./logger": "./lib/logger/index.js",
"./params": "./lib/params/index.js",
Expand Down
Loading