Backend rework#27
Conversation
Mostly taken from serverless/package.json
We will define functions seperately in functions/src/. Each file in src will be responsible for importing their own dependencies. Also note that each file can export more than one function so we can group related functions into the same files (ex: email.js)
|
Looks awesome so far! Are we removing the |
bobheadxi
left a comment
There was a problem hiding this comment.
🚀
however:
bobbook:nwhacks2019 robertlin$ make functions
(cd ./functions ; yarn serve)
yarn run v1.7.0
$ firebase serve --only functions
Error: No project active, but project aliases are available.
Run firebase use <alias> with one of these options:
development (nwhacks-2019-dev)
production (nwhacks-2019)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
make: *** [functions] Error 1
🤔
| "no-regex-spaces": "off", | ||
|
|
||
| // Removed rule "disallow the use of debugger" from recommended eslint rules | ||
| "no-debugger": "off", |
There was a problem hiding this comment.
does this really need a comment for each rule?
There was a problem hiding this comment.
firebase init seemed to think so, I'm gonna leave them there because some of them do seem useful.
| "plugins": [ | ||
| "promise" | ||
| ], | ||
| "extends": "eslint:recommended", |
There was a problem hiding this comment.
any thoughts on extending AirBNB-base (for more consistency with the front-end)?
There was a problem hiding this comment.
Good idea, will do
| # Runs interactive shell for cloud functions | ||
| .PHONY: shell | ||
| shell: | ||
| (cd ./functions ; yarn start) |
| "start": "yarn pick:dev && yarn run shell", | ||
| "deploy:dev": "yarn pick:dev && firebase deploy --only functions", | ||
| "deploy:prod": "yarn pick:prod && firebase deploy --only functions", | ||
| "logs": "firebase functions:log" |
There was a problem hiding this comment.
travis is looking for a test script here, can probably copy the one that used to be in serverless or add a simple one-liner that exits with 0 to appease travis for now
bobheadxi
left a comment
There was a problem hiding this comment.
Good stuff - lots of changes here, let's get this PR landed ASAP 🗡 🐦 🍽
👷 Changes
make functionsto host HTTP functions locallymake shellto host the functions in an interactive shellmake deploy-devormake deploy-prodto upload functions directly from command line (no more repo mirroring required)Will be adding unit testing
soon™in the next PR.