firebase-tools 15.19.1 → 15.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/appdistribution/client.js +6 -5
- package/lib/appdistribution/options-parser-util.js +21 -0
- package/lib/apphosting/constants.js +2 -1
- package/lib/apphosting/localbuilds.js +4 -2
- package/lib/archiveDirectory.js +2 -2
- package/lib/auth.js +2 -3
- package/lib/bin/cli.js +26 -18
- package/lib/commands/appdistribution-distribute.js +13 -4
- package/lib/commands/apptesting.js +18 -3
- package/lib/commands/crashlytics-symbols-upload.js +2 -2
- package/lib/crashlytics/sourcemap.js +3 -4
- package/lib/database/import.js +2 -2
- package/lib/dataconnect/build.js +6 -6
- package/lib/deploy/apphosting/util.js +9 -1
- package/lib/deploy/dataconnect/context.js +0 -2
- package/lib/deploy/dataconnect/deploy.js +0 -19
- package/lib/deploy/functions/prepare.js +47 -107
- package/lib/deploy/functions/prepareFunctionsUpload.js +1 -2
- package/lib/deploy/functions/release/index.js +0 -5
- package/lib/deploy/functions/services/ailogic.js +17 -10
- package/lib/deploy/functions/services/auth.js +3 -0
- package/lib/deploy/functions/services/database.js +18 -0
- package/lib/deploy/functions/services/dataconnect.js +20 -0
- package/lib/deploy/functions/services/firestore.js +12 -0
- package/lib/deploy/functions/services/index.js +18 -7
- package/lib/deploy/functions/services/storage.js +14 -0
- package/lib/deploy/functions/triggerRegionHelper.js +2 -4
- package/lib/emulator/auth/apiSpec.js +307 -33
- package/lib/emulator/auth/cloudFunctions.js +2 -2
- package/lib/emulator/auth/operations.js +99 -9
- package/lib/emulator/auth/state.js +27 -0
- package/lib/emulator/downloadableEmulatorInfo.json +24 -24
- package/lib/emulator/functionsEmulatorShell.js +4 -4
- package/lib/emulator/functionsRuntimeWorker.js +2 -2
- package/lib/emulator/pubsubEmulator.js +3 -3
- package/lib/emulator/storage/apis/firebase.js +2 -2
- package/lib/emulator/storage/cloudFunctions.js +2 -2
- package/lib/emulator/storage/metadata.js +1 -2
- package/lib/emulator/storage/persistence.js +2 -2
- package/lib/emulator/storage/upload.js +3 -3
- package/lib/env.js +20 -4
- package/lib/experiments.js +1 -2
- package/lib/frameworks/angular/index.js +3 -2
- package/lib/frameworks/angular/utils.js +100 -2
- package/lib/frameworks/astro/index.js +1 -1
- package/lib/frameworks/astro/utils.js +1 -1
- package/lib/functions/python.js +4 -4
- package/lib/gcp/location.js +16 -1
- package/lib/hosting/cloudRunProxy.js +8 -0
- package/lib/index.js +2 -2
- package/lib/init/features/apphosting.js +8 -1
- package/lib/init/features/dataconnect/create_app.js +3 -4
- package/lib/init/features/dataconnect/sdk.js +2 -2
- package/lib/init/features/functions/python.js +32 -20
- package/lib/localFunction.js +4 -2
- package/lib/mcp/tools/apptesting/tests.js +3 -1
- package/lib/track.js +2 -2
- package/lib/tsconfig.compile.tsbuildinfo +1 -1
- package/lib/tsconfig.publish.tsbuildinfo +1 -1
- package/lib/utils.js +70 -0
- package/package.json +1 -6
package/lib/utils.js
CHANGED
|
@@ -63,6 +63,9 @@ exports.commandExistsSync = commandExistsSync;
|
|
|
63
63
|
exports.resolveWithin = resolveWithin;
|
|
64
64
|
exports.toLowerSnakeCase = toLowerSnakeCase;
|
|
65
65
|
exports.murmurHashV3 = murmurHashV3;
|
|
66
|
+
exports.formatFilesize = formatFilesize;
|
|
67
|
+
exports.pLimit = pLimit;
|
|
68
|
+
exports.stringDistance = stringDistance;
|
|
66
69
|
const fs = require("fs-extra");
|
|
67
70
|
const tty = require("tty");
|
|
68
71
|
const path = require("node:path");
|
|
@@ -744,3 +747,70 @@ function murmurHashV3(key, seed = 0) {
|
|
|
744
747
|
h1 ^= h1 >>> 16;
|
|
745
748
|
return h1 >>> 0;
|
|
746
749
|
}
|
|
750
|
+
function formatFilesize(bytes, decimals = 2) {
|
|
751
|
+
if (bytes <= 0)
|
|
752
|
+
return "0 Bytes";
|
|
753
|
+
const k = 1024;
|
|
754
|
+
const dm = decimals < 0 ? 0 : decimals;
|
|
755
|
+
const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
|
|
756
|
+
const i = Math.min(Math.floor(Math.log(bytes) / Math.log(k)), sizes.length - 1);
|
|
757
|
+
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + " " + sizes[i];
|
|
758
|
+
}
|
|
759
|
+
function pLimit(concurrency) {
|
|
760
|
+
if (!Number.isInteger(concurrency) || concurrency <= 0) {
|
|
761
|
+
throw new error_1.FirebaseError(`pLimit concurrency must be a positive integer, got ${concurrency}`);
|
|
762
|
+
}
|
|
763
|
+
const queue = [];
|
|
764
|
+
let activeCount = 0;
|
|
765
|
+
const next = () => {
|
|
766
|
+
activeCount--;
|
|
767
|
+
if (queue.length > 0) {
|
|
768
|
+
queue.shift()?.();
|
|
769
|
+
}
|
|
770
|
+
};
|
|
771
|
+
return (fn) => {
|
|
772
|
+
return new Promise((resolve, reject) => {
|
|
773
|
+
const run = () => {
|
|
774
|
+
activeCount++;
|
|
775
|
+
try {
|
|
776
|
+
Promise.resolve(fn()).then(resolve, reject).finally(next);
|
|
777
|
+
}
|
|
778
|
+
catch (err) {
|
|
779
|
+
reject(err);
|
|
780
|
+
next();
|
|
781
|
+
}
|
|
782
|
+
};
|
|
783
|
+
if (activeCount < concurrency) {
|
|
784
|
+
run();
|
|
785
|
+
}
|
|
786
|
+
else {
|
|
787
|
+
queue.push(run);
|
|
788
|
+
}
|
|
789
|
+
});
|
|
790
|
+
};
|
|
791
|
+
}
|
|
792
|
+
function stringDistance(a, b) {
|
|
793
|
+
if (a === b)
|
|
794
|
+
return 0;
|
|
795
|
+
if (a.length === 0)
|
|
796
|
+
return b.length;
|
|
797
|
+
if (b.length === 0)
|
|
798
|
+
return a.length;
|
|
799
|
+
const [s1, s2] = a.length <= b.length ? [a, b] : [b, a];
|
|
800
|
+
const v0 = new Array(s1.length + 1);
|
|
801
|
+
const v1 = new Array(s1.length + 1);
|
|
802
|
+
for (let i = 0; i <= s1.length; i++) {
|
|
803
|
+
v0[i] = i;
|
|
804
|
+
}
|
|
805
|
+
for (let i = 0; i < s2.length; i++) {
|
|
806
|
+
v1[0] = i + 1;
|
|
807
|
+
for (let j = 0; j < s1.length; j++) {
|
|
808
|
+
const cost = s1[j] === s2[i] ? 0 : 1;
|
|
809
|
+
v1[j + 1] = Math.min(v1[j] + 1, v0[j + 1] + 1, v0[j] + cost);
|
|
810
|
+
}
|
|
811
|
+
for (let j = 0; j <= s1.length; j++) {
|
|
812
|
+
v0[j] = v1[j];
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
return v0[s1.length];
|
|
816
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "firebase-tools",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.21.0",
|
|
4
4
|
"description": "Command-Line Interface for Firebase",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"mcpName": "io.github.firebase/firebase-mcp",
|
|
@@ -86,11 +86,9 @@
|
|
|
86
86
|
"cross-env": "^7.0.3",
|
|
87
87
|
"cross-spawn": "^7.0.5",
|
|
88
88
|
"csv-parse": "^5.0.4",
|
|
89
|
-
"deep-equal-in-any-order": "^2.0.6",
|
|
90
89
|
"exegesis": "^4.2.0",
|
|
91
90
|
"exegesis-express": "^4.0.0",
|
|
92
91
|
"express": "^4.16.4",
|
|
93
|
-
"filesize": "^6.1.0",
|
|
94
92
|
"form-data": "^4.0.1",
|
|
95
93
|
"fs-extra": "^10.1.0",
|
|
96
94
|
"fuzzy": "^0.1.3",
|
|
@@ -100,7 +98,6 @@
|
|
|
100
98
|
"ignore": "^7.0.4",
|
|
101
99
|
"js-yaml": "^3.14.2",
|
|
102
100
|
"jsonwebtoken": "^9.0.2",
|
|
103
|
-
"leven": "^3.1.0",
|
|
104
101
|
"libsodium-wrappers": "^0.7.10",
|
|
105
102
|
"lodash": "^4.18.0",
|
|
106
103
|
"lsofi": "^2.0.0",
|
|
@@ -112,7 +109,6 @@
|
|
|
112
109
|
"node-fetch": "^2.6.7",
|
|
113
110
|
"open": "^6.3.0",
|
|
114
111
|
"ora": "^5.4.1",
|
|
115
|
-
"p-limit": "^3.0.1",
|
|
116
112
|
"pg": "^8.11.3",
|
|
117
113
|
"pg-gateway": "^0.3.0-beta.4",
|
|
118
114
|
"pglite-2": "npm:@electric-sql/pglite@0.2.17",
|
|
@@ -131,7 +127,6 @@
|
|
|
131
127
|
"triple-beam": "^1.3.0",
|
|
132
128
|
"universal-analytics": "^0.5.3",
|
|
133
129
|
"update-notifier-cjs": "^5.1.6",
|
|
134
|
-
"uuid": "^11.1.1",
|
|
135
130
|
"winston": "^3.0.0",
|
|
136
131
|
"winston-transport": "^4.4.0",
|
|
137
132
|
"ws": "^7.5.10",
|