-
Notifications
You must be signed in to change notification settings - Fork 216
feat: add file-based function discovery mode #1711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
e0d6028
62e37ba
0c2da1f
a5f0b05
08aca82
0222d2f
900d316
d48b3a2
088534a
d384aaf
ebebfa0
74e3275
478b8c2
b5b75e1
9d78c6d
c0dba6c
aef0d6d
e20a528
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
const functions = require("firebase-functions"); | ||
|
||
// This will cause a syntax error | ||
exports.broken = functions.https.onRequest((request, response) => { | ||
response.send("Hello from Firebase!" | ||
}); // Missing closing parenthesis |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"name": "broken-syntax" | ||
} |
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -49,34 +49,62 @@ if (args.length > 1) { | |||||||||
functionsDir = args[0]; | ||||||||||
} | ||||||||||
|
||||||||||
let server: http.Server = undefined; | ||||||||||
const app = express(); | ||||||||||
const MANIFEST_PREFIX = "__FIREBASE_FUNCTIONS_MANIFEST__:"; | ||||||||||
const MANIFEST_ERROR_PREFIX = "__FIREBASE_FUNCTIONS_MANIFEST_ERROR__:"; | ||||||||||
|
||||||||||
function handleQuitquitquit(req: express.Request, res: express.Response) { | ||||||||||
async function runStdioDiscovery() { | ||||||||||
try { | ||||||||||
const stack = await loadStack(functionsDir); | ||||||||||
const wireFormat = stackToWire(stack); | ||||||||||
const manifestJson = JSON.stringify(wireFormat); | ||||||||||
const base64 = Buffer.from(manifestJson).toString("base64"); | ||||||||||
process.stderr.write(`${MANIFEST_PREFIX}${base64}\n`); | ||||||||||
process.exit(0); | ||||||||||
|
process.stderr.write(`${MANIFEST_PREFIX}${base64}\n`); | |
process.exit(0); | |
process.stderr.write(`${MANIFEST_PREFIX}${base64}\n`); | |
process.exitCode = 0; |
Uh oh!
There was an error while loading. Please reload this page.