Skip to content
Merged
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
1,110 changes: 497 additions & 613 deletions firestore-bigquery-export/firestore-bigquery-change-tracker/package-lock.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"main": "./lib/index.js",
"scripts": {
"build": "npm run clean && npm run compile",
"clean": "rimraf lib",
"clean": "node -e \"require('fs').rmSync('lib', { recursive: true, force: true })\"",
"compile": "tsc",
"test:local": "jest",
"prepare": "npm run build",
Expand All @@ -27,7 +27,6 @@
"@google-cloud/resource-manager": "^5.1.0",
"firebase-admin": "^13.2.0",
"firebase-functions": "^6.3.2",
"node-fetch": "^2.6.1",
"sql-formatter": "^2.3.3",
"traverse": "^0.6.6"
},
Expand All @@ -43,7 +42,6 @@
"jest-summarizing-reporter": "^1.1.4",
"mocked-env": "^1.3.2",
"nyc": "^17.1.0",
"rimraf": "^2.6.3",
"ts-jest": "29.4.9",
"typescript": "^4.9.4",
"wait-for-expect": "^3.0.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import * as bigquery from "@google-cloud/bigquery";
import { DocumentReference } from "firebase-admin/firestore";
import * as traverse from "traverse";
import fetch from "node-fetch";
import {
RawChangelogSchema,
documentIdField,
Expand Down Expand Up @@ -125,7 +124,7 @@ export class FirestoreBigQueryEventHistoryTracker
body: JSON.stringify({ data: rows }),
headers: { "Content-Type": "application/json" },
});
const responseJson = await response.json();
const responseJson: any = await response.json();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using any as a type assertion disables TypeScript's type safety checks. Since the response from a callable function has a known expected structure (containing either a result.data or data property), we can use a more specific type assertion to maintain type safety while still allowing the underlying data to be of any type.

      const responseJson = (await response.json()) as {
        result?: { data?: any };
        data?: any;
      };

// To support callable functions, first check result.data
return responseJson?.result?.data ?? responseJson.data;
}
Expand Down
1,686 changes: 240 additions & 1,446 deletions firestore-bigquery-export/functions/package-lock.json

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions firestore-bigquery-export/functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"build": "npm run clean && npm run compile",
"prepare": "npm run build",
"clean": "rimraf lib",
"clean": "node -e \"require('fs').rmSync('lib', { recursive: true, force: true })\"",
"compile": "tsc -p tsconfig.build.json",
"test": "jest",
"generate-readme": "firebase ext:info .. --markdown > ../README.md"
Expand All @@ -20,7 +20,6 @@
"firebase-functions": "^6.3.2",
"generate-schema": "^2.6.0",
"lodash": "^4.17.14",
"rimraf": "^6.1.3",
"sql-formatter": "^2.3.3",
"typescript": "^4.8.4"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"scripts": {
"build": "npm run clean && npm run compile",
"clean": "rimraf ./lib",
"clean": "node -e \"require('fs').rmSync('lib', { recursive: true, force: true })\"",
"compile": "tsc && copyfiles \"src/__tests__/fixtures/**/*\" lib/__tests__",
"gen-schema-views": "node ./lib/index.js",
"prepare": "npm run build",
Expand All @@ -31,7 +31,7 @@
"author": "Jan Wyszynski <wyszynski@google.com>",
"license": "Apache-2.0",
"dependencies": {
"@firebaseextensions/firestore-bigquery-change-tracker": "^2.0.2",
"@firebaseextensions/firestore-bigquery-change-tracker": "^2.0.3",
"@genkit-ai/googleai": "^1.14.1",
"@google-cloud/bigquery": "^8.1.1",
"commander": "5.1.0",
Expand Down
4 changes: 2 additions & 2 deletions firestore-bigquery-export/scripts/import/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"scripts": {
"build": "npm run clean && npm run compile",
"build-watch": "npm run clean && tsc --watch",
"clean": "rimraf ./lib",
"clean": "node -e \"require('fs').rmSync('lib', { recursive: true, force: true })\"",
"compile": "tsc",
"import": "node ./lib/index.js",
"prepare": "npm run build",
Expand All @@ -28,7 +28,7 @@
"author": "Jan Wyszynski <wyszynski@google.com>",
"license": "Apache-2.0",
"dependencies": {
"@firebaseextensions/firestore-bigquery-change-tracker": "^2.0.2",
"@firebaseextensions/firestore-bigquery-change-tracker": "^2.0.3",
"@google-cloud/bigquery": "^5.6.0",
"commander": "5.1.0",
"filenamify": "^4.2.0",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"format": "prettier --write \"**/*.{js,md,yml,ts,json,yaml}\"",
"lint": "prettier --list-different \"**/*.{js,md,yml,ts,json,yaml}\"",
"clean": "lerna run --parallel clean && lerna clean",
"build": "lerna run build",
"build": "lerna run --sort build",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The --sort option is not a valid flag for lerna run and will cause the build command to fail with an unknown option error. By default, Lerna already runs scripts in topological (dependency) order. If you want to ensure topological sorting, the default lerna run build is sufficient.

Suggested change
"build": "lerna run --sort build",
"build": "lerna run build",

"local:emulator": "cd _emulator && firebase emulators:start -P demo-test",
"test": "cd _emulator && firebase emulators:exec jest -P demo-test",
"test:ci": "cd _emulator && firebase emulators:exec \"CI_TEST=true jest --detectOpenHandles --verbose --forceExit\" -P demo-test",
Expand Down
Loading