Skip to content

Commit 3eae1c1

Browse files
fix(ext): update TypeScript templates for ext:dev:init (#9629)
* fix(ext): update TypeScript templates for ext:dev:init The default TypeScript extension template generated by `firebase ext:dev:init` was failing to build due to outdated dependencies and TypeScript configuration. This commit updates the templates to: - Bump the TypeScript version to `^5.3.0` in `package.json`. - Add `"skipLibCheck": true` to `tsconfig.json`. - Change the `firebase-functions` import to `firebase-functions/v1`. These changes ensure that newly generated TypeScript extensions build successfully without any errors. * Update CHANGELOG.md --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
1 parent 85d4e73 commit 3eae1c1

File tree

5 files changed

+6
-4
lines changed

5 files changed

+6
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Updated TypeScript templates for `ext:dev:init` to fix build failures (#9524)

templates/extensions/typescript/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* https://firebase.google.com/docs/extensions/publishers
99
*/
1010

11-
import * as functions from "firebase-functions";
11+
import * as functions from "firebase-functions/v1";
1212

1313
exports.greetTheWorld = functions.https.onRequest(
1414
(req: functions.Request, res: functions.Response) => {

templates/extensions/typescript/package.lint.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"eslint": "^8.15.1",
2222
"eslint-plugin-import": "^2.26.0",
2323
"eslint-config-google": "^0.14.0",
24-
"typescript": "^4.9.0",
24+
"typescript": "^5.3.0",
2525
"axios": "^1.3.2",
2626
"chai": "^4.3.7",
2727
"mocha": "^10.2.0",

templates/extensions/typescript/package.nolint.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"devDependencies": {
1515
"@types/chai": "^4.3.4",
1616
"@types/mocha": "^10.0.1",
17-
"typescript": "^4.9.0",
17+
"typescript": "^5.3.0",
1818
"axios": "^1.3.2",
1919
"chai": "^4.3.7",
2020
"mocha": "^10.2.0",

templates/extensions/typescript/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"outDir": "lib",
77
"sourceMap": true,
88
"strict": true,
9-
"target": "es2017"
9+
"target": "es2017",
10+
"skipLibCheck": true
1011
},
1112
"compileOnSave": true,
1213
"include": [

0 commit comments

Comments
 (0)