-
Notifications
You must be signed in to change notification settings - Fork 919
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug where function discovery failed on projects using yarn worksp…
…aces. (#5215)
- Loading branch information
Showing
11 changed files
with
110 additions
and
27 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
scripts/functions-discover-tests/fixtures/yarn-workspaces/firebase.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,5 @@ | ||
{ | ||
"functions": { | ||
"source": "packages/functions" | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
scripts/functions-discover-tests/fixtures/yarn-workspaces/install.sh
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' | ||
|
||
yarn install |
5 changes: 5 additions & 0 deletions
5
scripts/functions-discover-tests/fixtures/yarn-workspaces/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,5 @@ | ||
{ | ||
"name": "yarn-workspace", | ||
"private": true, | ||
"workspaces": ["packages/functions", "packages/a"] | ||
} |
1 change: 1 addition & 0 deletions
1
scripts/functions-discover-tests/fixtures/yarn-workspaces/packages/a/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 @@ | ||
exports.msg = "Hello world!"; |
4 changes: 4 additions & 0 deletions
4
scripts/functions-discover-tests/fixtures/yarn-workspaces/packages/a/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,4 @@ | ||
{ | ||
"name": "a", | ||
"version": "0.0.1" | ||
} |
11 changes: 11 additions & 0 deletions
11
scripts/functions-discover-tests/fixtures/yarn-workspaces/packages/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,11 @@ | ||
const functions = require("firebase-functions"); | ||
const { onRequest } = require("firebase-functions/v2/https"); | ||
const { msg } = require("a"); | ||
|
||
exports.hellov1 = functions.https.onRequest((request, response) => { | ||
response.send(msg); | ||
}); | ||
|
||
exports.hellov2 = onRequest((request, response) => { | ||
response.send(msg); | ||
}); |
12 changes: 12 additions & 0 deletions
12
scripts/functions-discover-tests/fixtures/yarn-workspaces/packages/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,12 @@ | ||
{ | ||
"name": "simple", | ||
"version": "0.0.1", | ||
"dependencies": { | ||
"firebase-functions": "4.0.0", | ||
"firebase-admin": "^11.2.0", | ||
"a": "latest" | ||
}, | ||
"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
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