Cloud Functions + Typescriptのローカル開発
code:sh
npm init
gibo dump node >> .gitignore
echo "build" >> .gitignore
buildディレクトリもignoreしている
code:sh
npm install @google-cloud/functions-framework
code:sh
npx gts init
npm install @types/express concurrently nodemon --save-dev
npxでコマンドを実行したいときは、package.jsonに書かないでも、npx コマンド名打つだけで実行してくれる。
GoogleのTypescript style guideらしい
複数コマンドを同時実行する
並列実行
&&でつなぐと前の項目が終了しないと次のが実行されないのでこういうケースに便利らしい
今回はインストールなので&&でもよかったのでは?
code:package.json
"scripts": {
"start": "functions-framework --source=build/src/ --target=helloWorld",
"watch": "concurrently \"tsc -w\" \"nodemon --watch ./build/ --exec npm run start\"",
...
}