Skip to content

Firebase Functions ships with a binary #1003

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

Merged
merged 70 commits into from
Feb 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
72c66ef
WIP.
taeold Oct 27, 2021
fb5af88
It's v1alpha1
taeold Oct 27, 2021
3c58ff3
Finish writing test. Cleanup.
taeold Oct 27, 2021
5b369f1
Prettier.
taeold Oct 27, 2021
2db4640
Nits.
taeold Oct 27, 2021
306c269
Prettier
taeold Oct 27, 2021
f5b0e35
Merge branch 'master' into dl-endpoint-prop
taeold Oct 27, 2021
584ff6d
Unroll v1alpha manifest out of dir.
taeold Oct 29, 2021
11a08fc
Merge branch 'dl-endpoint-prop' of https://github.com/firebase/fireba…
taeold Oct 29, 2021
e1d9003
Prefer timeoutSeconds over timeout.
taeold Nov 3, 2021
69a8846
Prefer topic over generic resource.
taeold Nov 3, 2021
8d7cbee
Whoops this shouldn't go.
taeold Nov 3, 2021
eb0a9b0
Refactor vpc option.
taeold Nov 4, 2021
105cc7c
Finalize refactor.
taeold Nov 4, 2021
3de212b
Don't transform SA, consistent fn name.
taeold Nov 5, 2021
c765db5
Unroll trigger options.
taeold Nov 5, 2021
08cde7a
Make callable its own trigger, fix tests.
taeold Nov 5, 2021
fafcbd5
No need for dynamic props.
taeold Nov 5, 2021
7864635
Prettier.
taeold Nov 5, 2021
4ca1d44
Better types.
taeold Nov 6, 2021
3f47fdc
Few more fixes.
taeold Nov 8, 2021
726b4eb
One mo nit.
taeold Nov 8, 2021
5eda9cd
No getters if unncessary.
taeold Nov 8, 2021
cec015f
Prettier.
taeold Nov 8, 2021
10f88da
Merge branch 'master' of https://github.com/firebase/firebase-functio…
taeold Nov 9, 2021
11f18e8
Rely on default converter function.
taeold Nov 13, 2021
fe43588
Simplify logic for copying vpc options.
taeold Nov 13, 2021
5ed6027
Include parameter name in spec.
taeold Oct 20, 2021
07ba07f
Prettier.
taeold Oct 20, 2021
c413494
First pass at runtime w/ only admin endpoint, BREAKING CHANGE.
taeold Oct 27, 2021
c02c299
Fix typo.
taeold Oct 27, 2021
745d925
Minor fixes.
taeold Oct 27, 2021
0ed1558
First pass at runtime w/ only admin endpoint, BREAKING CHANGE.
taeold Oct 27, 2021
fd544ab
Prettier.
taeold Oct 29, 2021
ada97f3
Implement admin server for discovering endpoints.
taeold Nov 9, 2021
8740acc
Fixup deps.
taeold Nov 9, 2021
5e0540d
Modify workflow to compile tsc before running test.
taeold Nov 9, 2021
3e2f747
Fix typo.
taeold Nov 9, 2021
18c2487
Add trailing spaces.
taeold Nov 9, 2021
208dc23
Cleanup test impl.
taeold Nov 22, 2021
bb500c3
Annotate function triggers with __endpoint property (#999)
taeold Nov 22, 2021
5f2fa90
Add missing import.
taeold Nov 22, 2021
6e3a026
Endpoint annotation on task queue function.
taeold Nov 24, 2021
58f05dc
Loose ends on endpoint annotation on event triggers.
taeold Nov 24, 2021
24e1d42
Reformat + endpoint annotations for handlerr namespace.
taeold Nov 24, 2021
27c5fca
Add more unit tests.
taeold Nov 24, 2021
2439ad1
Refactor to simplify test code.
taeold Nov 24, 2021
654dd47
Rest of specs.
taeold Nov 24, 2021
8a32230
Prettier.
taeold Nov 24, 2021
64b3572
Backend is stack, extract APIs.
taeold Nov 25, 2021
a5e0262
Merge branch 'dl-endoint-prop-2' into dl-ff-runtime
taeold Nov 25, 2021
554a33e
More nits for unnecessary silence trick.
taeold Nov 25, 2021
1430fa5
Extend testing on the loader module.
taeold Nov 25, 2021
995b140
WIP - write better tests.
taeold Nov 29, 2021
9a9f0f0
Merge branch 'dl-endoint-prop-2' into dl-ff-runtime
taeold Dec 7, 2021
c2de5b4
Fix broken test
taeold Dec 7, 2021
6f2219c
Better merge strategy for required apis.
taeold Dec 7, 2021
9a2cd47
More of annotate endpoint property for functions (#1009)
taeold Dec 10, 2021
732a8a8
Merge branch 'dl-container-contract' of https://github.com/firebase/f…
taeold Dec 10, 2021
3a0c353
Prettier.
taeold Dec 10, 2021
f3297f4
Fix bug merging requiredAPIs, add tests.
taeold Dec 10, 2021
1d61a4c
Remove unnecessary imports.
taeold Dec 10, 2021
2a7d78d
Some style nits.
taeold Dec 10, 2021
f756646
It's stack not backend.
taeold Dec 10, 2021
fe536d2
Assume current dir if arg is missing.
taeold Dec 10, 2021
20faaea
Prettier.
taeold Dec 10, 2021
5512e15
Merge remote-tracking branch 'origin/master' into dl-ff-runtime
taeold Feb 2, 2022
7560cf4
PR feedbacks.
taeold Feb 2, 2022
7d0be1e
Prettier.
taeold Feb 2, 2022
1510689
Cloud scheduler is needed for both v1 and v2 scheduled fns.
taeold Feb 2, 2022
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
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ jobs:
- run: npm install
- run: npm run lint
- run: npm run format
- run: npm run test
- run: npm run build && npm run test
109 changes: 101 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
"lib"
],
"main": "lib/index.js",
"bin": {
"firebase-functions": "./lib/bin/firebase-functions.js"
},
"types": "lib/index.d.ts",
"exports": {
".": "./lib/index.js",
Expand Down Expand Up @@ -178,6 +181,7 @@
"mz": "^2.7.0",
"nock": "^10.0.6",
"prettier": "^1.18.2",
"semver": "^7.3.5",
"sinon": "^7.3.2",
"ts-node": "^8.3.0",
"tslint": "^5.18.0",
Expand Down
9 changes: 9 additions & 0 deletions spec/fixtures/sources/commonjs-grouped/g1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const functions = require("../../../../src/index");

exports.groupedhttp = functions.https.onRequest((req, resp) => {
resp.status(200).send("PASS");
});

exports.groupedcallable = functions.https.onCall(() => {
return "PASS";
});
20 changes: 20 additions & 0 deletions spec/fixtures/sources/commonjs-grouped/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const functions = require("../../../../src/index");
const functionsv2 = require("../../../../src/v2/index");

exports.v1http = functions.https.onRequest((req, resp) => {
resp.status(200).send("PASS");
});

exports.v1callable = functions.https.onCall(() => {
return "PASS";
});

exports.v2http = functionsv2.https.onRequest((req, resp) => {
resp.status(200).send("PASS");
});

exports.v2callable = functionsv2.https.onCall(() => {
return "PASS";
});

exports.g1 = require("./g1");
3 changes: 3 additions & 0 deletions spec/fixtures/sources/commonjs-grouped/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name": "commonjs-grouped"
}
18 changes: 18 additions & 0 deletions spec/fixtures/sources/commonjs-main/functions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const functions = require("../../../../src/index");
const functionsv2 = require("../../../../src/v2/index");

exports.v1http = functions.https.onRequest((req, resp) => {
resp.status(200).send("PASS");
});

exports.v1callable = functions.https.onCall(() => {
return "PASS";
});

exports.v2http = functionsv2.https.onRequest((req, resp) => {
resp.status(200).send("PASS");
});

exports.v2callable = functionsv2.https.onCall(() => {
return "PASS";
});
4 changes: 4 additions & 0 deletions spec/fixtures/sources/commonjs-main/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "commonjs-main",
"main": "functions.js"
}
18 changes: 18 additions & 0 deletions spec/fixtures/sources/commonjs/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const functions = require("../../../../src/index");
const functionsv2 = require("../../../../src/v2/index");

exports.v1http = functions.https.onRequest((req, resp) => {
resp.status(200).send("PASS");
});

exports.v1callable = functions.https.onCall(() => {
return "PASS";
});

exports.v2http = functionsv2.https.onRequest((req, resp) => {
resp.status(200).send("PASS");
});

exports.v2callable = functionsv2.https.onCall(() => {
return "PASS";
});
3 changes: 3 additions & 0 deletions spec/fixtures/sources/commonjs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name": "commonjs"
}
18 changes: 18 additions & 0 deletions spec/fixtures/sources/esm-ext/index.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import * as functions from '../../../../lib/index.js';
import * as functionsv2 from "../../../../lib/v2/index.js";

export const v1http = functions.https.onRequest((req, resp) => {
resp.status(200).send("PASS");
});

export const v1callable = functions.https.onCall(() => {
return "PASS";
});

export const v2http = functionsv2.https.onRequest((req, resp) => {
resp.status(200).send("PASS");
});

export const v2callable = functionsv2.https.onCall(() => {
return "PASS";
});
4 changes: 4 additions & 0 deletions spec/fixtures/sources/esm-ext/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "esm-ext",
"main": "index.mjs"
}
18 changes: 18 additions & 0 deletions spec/fixtures/sources/esm-main/functions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import * as functions from "../../../../lib/index.js";
import * as functionsv2 from "../../../../lib/v2/index.js";

export const v1http = functions.https.onRequest((req, resp) => {
resp.status(200).send("PASS");
});

export const v1callable = functions.https.onCall(() => {
return "PASS";
});

export const v2http = functionsv2.https.onRequest((req, resp) => {
resp.status(200).send("PASS");
});

export const v2callable = functionsv2.https.onCall(() => {
return "PASS";
});
5 changes: 5 additions & 0 deletions spec/fixtures/sources/esm-main/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "esm-main",
"main": "functions.js",
"type": "module"
}
18 changes: 18 additions & 0 deletions spec/fixtures/sources/esm/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import * as functions from "../../../../lib/index.js";
import * as functionsv2 from "../../../../lib/v2/index.js";

export const v1http = functions.https.onRequest((req, resp) => {
resp.status(200).send("PASS");
});

export const v1callable = functions.https.onCall(() => {
return "PASS";
});

export const v2http = functionsv2.https.onRequest((req, resp) => {
resp.status(200).send("PASS");
});

export const v2callable = functionsv2.https.onCall(() => {
return "PASS";
});
4 changes: 4 additions & 0 deletions spec/fixtures/sources/esm/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "esm",
"type": "module"
}
Loading