Skip to content

Update to node20 for #1698 #1723

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/actions/setup-repo/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ inputs:
node-version:
description: "Version used by actions/setup-node"
required: true
default: "18"
default: "20"
yarn-version:
description: "Version of Yarn used to install dependencies"
required: true
Expand All @@ -13,7 +13,7 @@ runs:
using: "composite"
steps:
- name: Use Node.js ${{ inputs.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: "yarn"
Expand Down
2 changes: 1 addition & 1 deletion firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"functions": {
"predeploy": ["yarn build:functions"],
"source": "functions",
"runtime": "nodejs18"
"runtime": "nodejs20"
},
"firestore": {
"rules": "firestore.rules",
Expand Down
25 changes: 13 additions & 12 deletions functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
"@google-cloud/pubsub": "^3.0.1",
"axios": "^0.25.0",
"date-fns": "^2.30.0",
"firebase-admin": "^10",
"firebase-functions": "^3.22.0",
"firebase-admin": "^13.2.0",
"firebase-functions": "^6.3.2",
"fuse.js": "6.5.3",
"handlebars": "^4.7.8",
"lodash": "^4.17.21",
"luxon": "^2.3.1",
"luxon": "^3.5.0",
"nanoid": "^3.3.2",
"object-hash": "^3.0.0",
"runtypes": "6.5.1",
Expand All @@ -31,16 +31,17 @@
"zod": "^3.20.2"
},
"devDependencies": {
"@types/jest": "^27.4.0",
"@types/luxon": "^2.0.9",
"@types/object-hash": "^2.2.1",
"@types/jest": "^29.5.14",
"@types/luxon": "^3.4.2",
"@types/node": "20",
"@types/object-hash": "^3.0.6",
"copyfiles": "^2.4.1",
"firebase-functions-test": "^0.3.3",
"firebase-tools": "^11.16.0",
"jest": "^27.5.1",
"rimraf": "^3.0.2",
"ts-jest": "^27.1.3",
"typescript": "4.5.5"
"firebase-functions-test": "^3.4.0",
"firebase-tools": "^13.32.0",
"jest": "^29.7.0",
"rimraf": "^6.0.1",
"ts-jest": "^29.2.6",
"typescript": "5.8.2"
},
"private": true
}
2 changes: 1 addition & 1 deletion functions/src/analysis/updateBillTracker.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { runWith } from "firebase-functions"
import { runWith } from "firebase-functions/v1"
import { isEqual } from "lodash"
import { Bill } from "../bills/types"
import { db, Timestamp } from "../firebase"
Expand Down
2 changes: 1 addition & 1 deletion functions/src/auth/createFakeOrg.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as functions from "firebase-functions"
import * as functions from "firebase-functions/v1"
import { checkAdmin, checkAuth } from "../common"
import { auth, db } from "../firebase"

Expand Down
2 changes: 1 addition & 1 deletion functions/src/auth/createFakeTestimony.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as functions from "firebase-functions"
import * as functions from "firebase-functions/v1"
import { checkAdmin, checkAuth } from "../common"
import { auth, db } from "../firebase"
import { Testimony } from "../testimony/types"
Expand Down
2 changes: 1 addition & 1 deletion functions/src/auth/modifyAccount.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as functions from "firebase-functions"
import * as functions from "firebase-functions/v1"
import { db, auth } from "../firebase"
import { z } from "zod"
import { checkRequestZod, checkAuth, checkAdmin } from "../common"
Expand Down
2 changes: 1 addition & 1 deletion functions/src/bills/BillProcessor.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { QuerySnapshot } from "@google-cloud/firestore"
import { runWith } from "firebase-functions"
import { runWith } from "firebase-functions/v1"
import { City } from "../cities/types"
import { Committee } from "../committees/types"
import { DocUpdate } from "../common"
Expand Down
2 changes: 1 addition & 1 deletion functions/src/committees/updateCommitteeRosters.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { runWith } from "firebase-functions"
import { runWith } from "firebase-functions/v1"
import { DocUpdate } from "../common"
import { db } from "../firebase"
import { Member } from "../members/types"
Expand Down
2 changes: 1 addition & 1 deletion functions/src/common.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FieldValue } from "@google-cloud/firestore"
import axios from "axios"
import { https, logger } from "firebase-functions"
import { https, logger } from "firebase-functions/v1"
import {
Null,
Nullish,
Expand Down
2 changes: 1 addition & 1 deletion functions/src/events/scrapeEvents.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { runWith } from "firebase-functions"
import { runWith } from "firebase-functions/v1"
import { DateTime } from "luxon"
import { logFetchError } from "../common"
import { db, Timestamp } from "../firebase"
Expand Down
2 changes: 1 addition & 1 deletion functions/src/healthCheck.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as functions from "firebase-functions"
import * as functions from "firebase-functions/v1"

if (process.env.FUNCTIONS_EMULATOR === "true") {
// Export a health check used
Expand Down
2 changes: 1 addition & 1 deletion functions/src/members/createMemberSearchIndex.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { pubsub } from "firebase-functions"
import { pubsub } from "firebase-functions/v1"
import { db } from "../firebase"
import { currentGeneralCourt } from "../shared"

Expand Down
2 changes: 1 addition & 1 deletion functions/src/notifications/cleanupNotifications.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as functions from "firebase-functions"
import * as functions from "firebase-functions/v1"
import * as admin from "firebase-admin"
import { Timestamp } from "../firebase"

Expand Down
2 changes: 1 addition & 1 deletion functions/src/notifications/deliverNotifications.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as functions from "firebase-functions"
import * as functions from "firebase-functions/v1"
import * as admin from "firebase-admin"
import * as handlebars from "handlebars"
import * as fs from "fs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Creates a notification document in the user's notification feed for each active subscription.

// Import necessary Firebase modules
import * as functions from "firebase-functions"
import * as functions from "firebase-functions/v1"
import * as admin from "firebase-admin"
import { Timestamp } from "../firebase"
import { BillHistoryUpdateNotification } from "./types"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Creates a notification document in the user's notification feed for each active subscription.

// Import necessary Firebase modules
import * as functions from "firebase-functions"
import * as functions from "firebase-functions/v1"
import * as admin from "firebase-admin"
import { Timestamp } from "../firebase"
import { TestimonySubmissionNotification } from "./types"
Expand Down
2 changes: 1 addition & 1 deletion functions/src/notifications/publishNotifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Creates a notification document in the user's notification feed for each active subscription.

// Import necessary Firebase modules
import * as functions from "firebase-functions"
import * as functions from "firebase-functions/v1"
import * as admin from "firebase-admin"
import { Timestamp } from "../firebase"
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const functions = require("firebase-functions")
const functions = require("firebase-functions/v1")
import * as admin from "firebase-admin"
import { getNextDigestAt } from "./helpers"

Expand Down
2 changes: 1 addition & 1 deletion functions/src/profile/finishSignup.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as functions from "firebase-functions"
import * as functions from "firebase-functions/v1"
import { db, auth } from "../firebase"
import { z } from "zod"
import { checkRequestZod, checkAuth } from "../common"
Expand Down
2 changes: 1 addition & 1 deletion functions/src/scraper.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import axios, { AxiosError } from "axios"
import { logger, runWith } from "firebase-functions"
import { logger, runWith } from "firebase-functions/v1"
import { last } from "lodash"
import { db, DocumentData, FieldValue, Timestamp } from "./firebase"
import { currentGeneralCourt } from "./shared"
Expand Down
2 changes: 1 addition & 1 deletion functions/src/search/SearchIndexer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Change } from "firebase-functions"
import { Change } from "firebase-functions/v1"
import { isEqual, last } from "lodash"
import hash from "object-hash"
import Collection from "typesense/lib/Typesense/Collection"
Expand Down
2 changes: 1 addition & 1 deletion functions/src/search/checkSearchIndexVersion.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { runWith } from "firebase-functions"
import { runWith } from "firebase-functions/v1"
import { getRegisteredConfigs } from "./config"
import { SearchIndexer } from "./SearchIndexer"

Expand Down
2 changes: 1 addition & 1 deletion functions/src/search/createSearchIndexer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { runWith } from "firebase-functions"
import { runWith } from "firebase-functions/v1"
import { BaseRecord, CollectionConfig, registerConfig } from "./config"
import { SearchIndexer } from "./SearchIndexer"

Expand Down
2 changes: 1 addition & 1 deletion functions/src/search/searchHealthCheck.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { runWith } from "firebase-functions"
import { runWith } from "firebase-functions/v1"
import { createClient } from "./client"

const connectionTimeoutSeconds = 5,
Expand Down
2 changes: 1 addition & 1 deletion functions/src/subscriptions/followBill.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as functions from "firebase-functions"
import * as functions from "firebase-functions/v1"
import { subscribeToBillTopic } from "./subscribeToBillTopic"
import { getAuth, UserRecord } from "firebase-admin/auth"
import { getFirestore, Firestore } from "firebase-admin/firestore"
Expand Down
2 changes: 1 addition & 1 deletion functions/src/subscriptions/followUser.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as functions from "firebase-functions"
import * as functions from "firebase-functions/v1"
import { subscribeToTestimonyTopic } from "./subscribeToTestimonyTopic"
import { getAuth, UserRecord } from "firebase-admin/auth"
import { getFirestore, Firestore } from "firebase-admin/firestore"
Expand Down
2 changes: 1 addition & 1 deletion functions/src/subscriptions/unfollowBill.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as functions from "firebase-functions"
import * as functions from "firebase-functions/v1"
import { unsubscribeToBillTopic } from "./unsubscribeToBillTopic"
import { getAuth, UserRecord } from "firebase-admin/auth"
import { getFirestore, Firestore } from "firebase-admin/firestore"
Expand Down
2 changes: 1 addition & 1 deletion functions/src/subscriptions/unfollowUser.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as functions from "firebase-functions"
import * as functions from "firebase-functions/v1"
import { unsubscribeToTestimonyTopic } from "./unsubscribeToTestimonyTopic"
import { getAuth, UserRecord } from "firebase-admin/auth"
import { getFirestore, Firestore } from "firebase-admin/firestore"
Expand Down
2 changes: 1 addition & 1 deletion functions/src/testimony/deleteTestimony.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DocumentSnapshot } from "@google-cloud/firestore"
import { https, logger } from "firebase-functions"
import { https, logger } from "firebase-functions/v1"
import { Record } from "runtypes"
import { Bill } from "../bills/types"
import {
Expand Down
2 changes: 1 addition & 1 deletion functions/src/testimony/publishTestimony.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DocumentReference, DocumentSnapshot } from "@google-cloud/firestore"
import { https, logger } from "firebase-functions"
import { https, logger } from "firebase-functions/v1"
import { nanoid } from "nanoid"
import { Record } from "runtypes"
import { Bill } from "../bills/types"
Expand Down
2 changes: 1 addition & 1 deletion functions/src/testimony/resolveReport.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as functions from "firebase-functions"
import * as functions from "firebase-functions/v1"
import { db } from "../firebase"
import { z } from "zod"
import { fail, checkRequestZod, checkAuth, checkAdmin } from "../common"
Expand Down
2 changes: 1 addition & 1 deletion functions/src/triggerPubsubFunction.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PubSub } from "@google-cloud/pubsub"
import * as functions from "firebase-functions"
import * as functions from "firebase-functions/v1"

const projectId = process.env.GCLOUD_PROJECT
const pubsubClient = new PubSub({ projectId })
Expand Down
Loading
Loading