-
Notifications
You must be signed in to change notification settings - Fork 944
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix broken pnpm support for cf3 (#5467)
Due to the way pnpm resolves packages with peer dependencies, location of the firebase functions sdk package isn't where the CLI expects it to be. We make the logic for finding the binary associated Firebase Functions SDK more robust by checking list of possible paths where it might exist. We also add integration test for pnpm in the functions discovery test. Fixes #5448
- Loading branch information
Showing
8 changed files
with
84 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
10 changes: 10 additions & 0 deletions
10
scripts/functions-discover-tests/fixtures/pnpm/functions/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const functions = require("firebase-functions"); | ||
const { onRequest } = require("firebase-functions/v2/https"); | ||
|
||
exports.hellov1 = functions.https.onRequest((request, response) => { | ||
response.send("Hello from Firebase!"); | ||
}); | ||
|
||
exports.hellov2 = onRequest((request, response) => { | ||
response.send("Hello from Firebase!"); | ||
}); |
9 changes: 9 additions & 0 deletions
9
scripts/functions-discover-tests/fixtures/pnpm/functions/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "pnpm", | ||
"dependencies": { | ||
"firebase-functions": "^4.0.0" | ||
}, | ||
"engines": { | ||
"node": "16" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
set -euxo pipefail # bash strict mode | ||
IFS=$'\n\t' | ||
|
||
cd functions && pnpm install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters