{"id":14967397,"url":"https://github.com/robisim74/firebase-functions-typescript-starter","last_synced_at":"2025-10-25T19:30:59.593Z","repository":{"id":143841935,"uuid":"117359160","full_name":"robisim74/firebase-functions-typescript-starter","owner":"robisim74","description":"Create \u0026 test Firebase Cloud Functions in TypeScript","archived":false,"fork":false,"pushed_at":"2021-12-08T21:38:34.000Z","size":228,"stargazers_count":106,"open_issues_count":2,"forks_count":30,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-10-01T05:51:46.042Z","etag":null,"topics":["firebase","firebase-cloud-functions","mocha","rollup","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robisim74.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-13T16:29:50.000Z","updated_at":"2024-09-24T10:48:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"bd4dd305-d7e3-4b26-b85c-5452720df405","html_url":"https://github.com/robisim74/firebase-functions-typescript-starter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robisim74%2Ffirebase-functions-typescript-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robisim74%2Ffirebase-functions-typescript-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robisim74%2Ffirebase-functions-typescript-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robisim74%2Ffirebase-functions-typescript-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robisim74","download_url":"https://codeload.github.com/robisim74/firebase-functions-typescript-starter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219865149,"owners_count":16555931,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["firebase","firebase-cloud-functions","mocha","rollup","typescript"],"created_at":"2024-09-24T13:37:59.863Z","updated_at":"2025-10-25T19:30:59.184Z","avatar_url":"https://github.com/robisim74.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Firebase Functions TypeScript starter\n\n\u003eCreate \u0026 test Firebase Cloud Functions in TypeScript\n\nThis starter allows you to create \u0026 test **Firebase Cloud Functions** in _TypeScript_.\n\nGet the [Changelog](https://github.com/robisim74/firebase-functions-typescript-starter/blob/master/CHANGELOG.md).\n\n## Contents\n* [1 Project structure](#1)\n* [2 Customizing](#2)\n* [3 Testing](#3)\n* [4 Building](#4)\n* [5 Publishing](#5)\n* [6 What it is important to know](#6)\n\n## \u003ca name=\"1\"\u003e\u003c/a\u003e1 Project structure\n- **functions**:\n    - **src** folder for the Functions\n        - **index.ts** entry point for all your Firebase Functions\n    - **tests** folder for the _Mocha_ tests\n    - **package.json** _npm_ options\n    - **rollup.config.js** _Rollup_ configuration for building the ES bundle\n    - **tsconfig.json** _TypeScript_ compiler options\n    - **.mocharc.json** _Mocha_ options\n    - **.eslintrc.json** _ESLint_ configuration\n- **.firebaserc**: Firebase projects\n\n## \u003ca name=\"2\"\u003e\u003c/a\u003e2 Customizing\n1. Update [Firebase CLI](https://github.com/firebase/firebase-tools).\n\n2. Update `.firebaserc` with your `project-id`.\n\n3. Add your Firebase Functions to `index.ts` and create different files for each one.\n\n4. Update in `rollup.config.js` file external dependencies with those that actually you use to build the ES bundle.\n\n5. Create unit tests in `tests` folder.\n\n## \u003ca name=\"3\"\u003e\u003c/a\u003e3 Testing\nThe following command runs unit tests using _Mocha_ that are in the `tests` folder: \n```Shell\nnpm test \n```\n\n## \u003ca name=\"4\"\u003e\u003c/a\u003e4 Building\n#### Development\nStart _tsc_ compiler with _watch_ option:\n```Shell\nnpm run build:dev\n```\n\nStart the emulator _firebase emulators:start --only functions_\n```Shell\nnpm run serve:dev\n```\n\nFor the other supported emulators, please refer to the official documentation: [\nRun Functions Locally](https://firebase.google.com/docs/functions/local-emulator)\n\n#### Production\nThe following command:\n```Shell\nnpm run build\n```\ncreates `lib` folder with the file of distribution:\n```\n└── functions\n    └──lib\n        └── index.js\n```\n\n## \u003ca name=\"5\"\u003e\u003c/a\u003e5 Publishing\n```Shell\nnpm run deploy\n```\n\n## \u003ca name=\"6\"\u003e\u003c/a\u003e6 What it is important to know\n1. _Node.js_\n\n    The engine in `package.json` is set to _Node.js 16_ \n\n2. ES Modules\n\n    _Node.js 16_ supports ES Modules: so you have `\"type\": \"module\"` in `package.json`, `format: 'es'` in `rollup.config.js` and `tsconfig.js` used by _tsc_ compiler targets ES2021 with ES2020 modules\n\n3. Bundling with _Rollup_\n\n    _Firebase Cloud Functions_ do not require the deployment of a single bundle. In any case the building with _Rollup_ offers some advantages:\n    * _Tree shaking_ of unused code\n    * No request for other files at runtime\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobisim74%2Ffirebase-functions-typescript-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobisim74%2Ffirebase-functions-typescript-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobisim74%2Ffirebase-functions-typescript-starter/lists"}