* Adds .gitignore for javascript template, adds node_modules and lib to .gitignore for typescript template
* writes gitignore file during javascript function init
* removing lib/ pattern, as it should be covered by .js and js.map rules
* changelist
-p (or the long version --project) was incorrectly referencing the linting configuration in tslint.json. Fixing this to reference the tsconfig.json file to enable rules that work with the type checker.
Using the long version --project as it is more readable
Add support for TypeScript when initializing Cloud Functions.
Meets agreed upon UX and implements the "optional" feature of linter support. Refactors
the functions.js into 3 different files: initalization for all languages, an NPM install helper
for all NPM based runtimes, and the JS implmentation. Then adds support for TypeScript along with
JavaScript. TypeScript adds a predeploy command to ensure TypeScript is always compiled before deploy.
I did a first pass on linter rules based on the full list on the tslint website. These are definitely open for discussion.
I'm curious whether we should add "(Experimental)" to the list when choosing TypeScript. There's a chance we will want to
change project structure or lint rules in the future and this could be seen as breaking. And as mentioend offline, there's
a wart that we didn't consider how this feature should work with the emulator either.
In general I want to chat a bit about ideal project structure. I'm worried that this is hard to add tests with the project
layout that we use in the firebase-functions codebase. I'm considering that maybe both should have SxS foo.ts and foo.spec.ts.
This would fix our use of a .tmp directory that has both "src" and "spec" inside it whereas production files are only in "lib".
If we were to do this, I might also recommend adding a ".npmignore" file and making the functions deploy process honor it. Since
we're already shipping unit tests I can't see this being a blocker for release.
Adding the database name back in to the path.
We're using the wildcard `{database}` since otherwise we'd have to percent escape the parens in the `(default)` database.