firebase-tools 15.34.0 → 15.34.1
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/auth.js +10 -5
- package/lib/commands/deploy.js +4 -0
- package/lib/commands/hosting-channel-create.js +3 -0
- package/lib/commands/hosting-channel-delete.js +3 -0
- package/lib/commands/hosting-channel-deploy.js +3 -0
- package/lib/commands/hosting-channel-list.js +3 -0
- package/lib/commands/hosting-channel-open.js +3 -0
- package/lib/commands/hosting-clone.js +14 -0
- package/lib/commands/hosting-disable.js +2 -0
- package/lib/commands/hosting-sites-create.js +3 -0
- package/lib/commands/hosting-sites-delete.js +3 -0
- package/lib/commands/hosting-sites-get.js +3 -0
- package/lib/commands/hosting-sites-list.js +3 -0
- package/lib/commands/run-services-update.js +2 -0
- package/lib/crashlytics/alerts.js +1 -11
- package/lib/crashlytics/onboarding.js +8 -3
- package/lib/deploy/functions/params.js +1 -0
- package/lib/deploy/hosting/prepare.js +3 -0
- package/lib/deploy/run/deploy.js +36 -8
- package/lib/deploy/run/prepare.js +54 -2
- package/lib/deploy/run/update.js +2 -1
- package/lib/deploy/run/util.js +2 -0
- package/lib/emulator/auth/cloudFunctions.js +47 -18
- package/lib/emulator/downloadableEmulatorInfo.json +24 -24
- package/lib/experiments.js +0 -5
- package/lib/init/features/run.js +40 -1
- package/lib/mcp/index.js +19 -3
- package/lib/tsconfig.compile.tsbuildinfo +1 -1
- package/lib/tsconfig.publish.tsbuildinfo +1 -1
- package/package.json +7 -1
|
@@ -54,36 +54,36 @@
|
|
|
54
54
|
},
|
|
55
55
|
"dataconnect": {
|
|
56
56
|
"darwin": {
|
|
57
|
-
"version": "3.4.
|
|
58
|
-
"expectedSize":
|
|
59
|
-
"expectedChecksum": "
|
|
60
|
-
"expectedChecksumSHA256": "
|
|
61
|
-
"remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-macos-amd64-v3.4.
|
|
62
|
-
"downloadPathRelativeToCacheDir": "dataconnect-emulator-3.4.
|
|
57
|
+
"version": "3.4.24",
|
|
58
|
+
"expectedSize": 35755952,
|
|
59
|
+
"expectedChecksum": "faeb22190b0b8fdc20256d37eb48401f",
|
|
60
|
+
"expectedChecksumSHA256": "c10461dfaf2e1fbe0f3f7883c77cc346427f56edc7a63c0bea9482c29c7c9e7f",
|
|
61
|
+
"remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-macos-amd64-v3.4.24",
|
|
62
|
+
"downloadPathRelativeToCacheDir": "dataconnect-emulator-3.4.24"
|
|
63
63
|
},
|
|
64
64
|
"darwin_arm64": {
|
|
65
|
-
"version": "3.4.
|
|
66
|
-
"expectedSize":
|
|
67
|
-
"expectedChecksum": "
|
|
68
|
-
"expectedChecksumSHA256": "
|
|
69
|
-
"remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-macos-arm64-v3.4.
|
|
70
|
-
"downloadPathRelativeToCacheDir": "dataconnect-emulator-3.4.
|
|
65
|
+
"version": "3.4.24",
|
|
66
|
+
"expectedSize": 33727618,
|
|
67
|
+
"expectedChecksum": "310374c3d7e6242658dcdbd3a1e8d394",
|
|
68
|
+
"expectedChecksumSHA256": "a59e26499e1cc3e1eba2c5187f8ac20bb555bebea3bb1f9d6785797814da59fb",
|
|
69
|
+
"remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-macos-arm64-v3.4.24",
|
|
70
|
+
"downloadPathRelativeToCacheDir": "dataconnect-emulator-3.4.24"
|
|
71
71
|
},
|
|
72
72
|
"win32": {
|
|
73
|
-
"version": "3.4.
|
|
74
|
-
"expectedSize":
|
|
75
|
-
"expectedChecksum": "
|
|
76
|
-
"expectedChecksumSHA256": "
|
|
77
|
-
"remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-windows-amd64-v3.4.
|
|
78
|
-
"downloadPathRelativeToCacheDir": "dataconnect-emulator-3.4.
|
|
73
|
+
"version": "3.4.24",
|
|
74
|
+
"expectedSize": 35738112,
|
|
75
|
+
"expectedChecksum": "a4e80670bcda4607c9a0917d17369ea5",
|
|
76
|
+
"expectedChecksumSHA256": "a03e10d1df00f10cbe55df5c9ee9808bf627e339e83e5e642e5414e95a1985b0",
|
|
77
|
+
"remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-windows-amd64-v3.4.24",
|
|
78
|
+
"downloadPathRelativeToCacheDir": "dataconnect-emulator-3.4.24.exe"
|
|
79
79
|
},
|
|
80
80
|
"linux": {
|
|
81
|
-
"version": "3.4.
|
|
82
|
-
"expectedSize":
|
|
83
|
-
"expectedChecksum": "
|
|
84
|
-
"expectedChecksumSHA256": "
|
|
85
|
-
"remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-linux-amd64-v3.4.
|
|
86
|
-
"downloadPathRelativeToCacheDir": "dataconnect-emulator-3.4.
|
|
81
|
+
"version": "3.4.24",
|
|
82
|
+
"expectedSize": 34762914,
|
|
83
|
+
"expectedChecksum": "6eb0f18c9647d7e57296c964c4ff4e18",
|
|
84
|
+
"expectedChecksumSHA256": "e7cb1f453c6388bd434627d70e1455ae53a99e36a2bd3dd3885844e5d5cd1769",
|
|
85
|
+
"remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-linux-amd64-v3.4.24",
|
|
86
|
+
"downloadPathRelativeToCacheDir": "dataconnect-emulator-3.4.24"
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
}
|
package/lib/experiments.js
CHANGED
|
@@ -202,11 +202,6 @@ exports.ALL_EXPERIMENTS = experiments({
|
|
|
202
202
|
default: false,
|
|
203
203
|
public: true,
|
|
204
204
|
},
|
|
205
|
-
crashlyticsWebAlerts: {
|
|
206
|
-
shortDescription: "Enable configuring Crashlytics email alerts during web app onboarding.",
|
|
207
|
-
default: false,
|
|
208
|
-
public: false,
|
|
209
|
-
},
|
|
210
205
|
crashlyticsWebBreadcrumbs: {
|
|
211
206
|
shortDescription: "Enable provisioning Cloud Trace storage during web app onboarding.",
|
|
212
207
|
default: false,
|
package/lib/init/features/run.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.askQuestions = askQuestions;
|
|
|
4
4
|
exports.actuate = actuate;
|
|
5
5
|
exports.upsertRunConfig = upsertRunConfig;
|
|
6
6
|
const path = require("path");
|
|
7
|
+
const app_1 = require("../../apphosting/app");
|
|
7
8
|
const deploy_1 = require("../../deploy");
|
|
8
9
|
const prereqs_1 = require("../../deploy/run/prereqs");
|
|
9
10
|
const util_1 = require("../../deploy/run/util");
|
|
@@ -11,6 +12,7 @@ const error_1 = require("../../error");
|
|
|
11
12
|
const fsutils_1 = require("../../fsutils");
|
|
12
13
|
const run = require("../../gcp/run");
|
|
13
14
|
const runv2 = require("../../gcp/runv2");
|
|
15
|
+
const apps_1 = require("../../management/apps");
|
|
14
16
|
const prompt_1 = require("../../prompt");
|
|
15
17
|
const requirePermissions_1 = require("../../requirePermissions");
|
|
16
18
|
const utils_1 = require("../../utils");
|
|
@@ -48,6 +50,7 @@ async function askQuestions(setup, config, options) {
|
|
|
48
50
|
});
|
|
49
51
|
serviceId = await promptNewServiceId(projectId, region);
|
|
50
52
|
}
|
|
53
|
+
const appId = existing?.annotations?.[util_1.FIREBASE_APP_ANNOTATION] ?? (await promptWebApp(projectId));
|
|
51
54
|
const savedEntry = findRunEntry(getRunEntries(config), serviceId, region);
|
|
52
55
|
const localBuild = await (0, prompt_1.select)({
|
|
53
56
|
message: "Would you like to build your app locally or remotely?",
|
|
@@ -70,8 +73,32 @@ async function askQuestions(setup, config, options) {
|
|
|
70
73
|
if (localBuild) {
|
|
71
74
|
runInfo.localBuild = true;
|
|
72
75
|
}
|
|
76
|
+
if (appId) {
|
|
77
|
+
runInfo.appId = appId;
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
runInfo.createWebApp = true;
|
|
81
|
+
}
|
|
73
82
|
setup.featureInfo = { ...setup.featureInfo, run: runInfo };
|
|
74
83
|
}
|
|
84
|
+
async function promptWebApp(projectId) {
|
|
85
|
+
const apps = await (0, apps_1.listFirebaseApps)(projectId, apps_1.AppPlatform.WEB);
|
|
86
|
+
if (!apps.length) {
|
|
87
|
+
return undefined;
|
|
88
|
+
}
|
|
89
|
+
const choice = await (0, prompt_1.select)({
|
|
90
|
+
message: "Which Firebase web app should this service use for Firebase SDK auto-initialization?",
|
|
91
|
+
choices: [
|
|
92
|
+
{ name: "Create a new web app", value: app_1.webApps.CREATE_NEW_FIREBASE_WEB_APP },
|
|
93
|
+
...apps.map((app) => ({
|
|
94
|
+
name: app.displayName ? `${app.displayName} (${app.appId})` : app.appId,
|
|
95
|
+
value: app.appId,
|
|
96
|
+
})),
|
|
97
|
+
],
|
|
98
|
+
default: app_1.webApps.CREATE_NEW_FIREBASE_WEB_APP,
|
|
99
|
+
});
|
|
100
|
+
return choice === app_1.webApps.CREATE_NEW_FIREBASE_WEB_APP ? undefined : choice;
|
|
101
|
+
}
|
|
75
102
|
async function promptExistingService(projectId) {
|
|
76
103
|
const allServices = await runv2.listServices(projectId, false);
|
|
77
104
|
const services = allServices.filter((s) => !s.labels?.[runv2.CLIENT_NAME_LABEL]);
|
|
@@ -132,7 +159,19 @@ async function actuate(setup, config, options) {
|
|
|
132
159
|
else {
|
|
133
160
|
upsertRunConfig(service, config);
|
|
134
161
|
}
|
|
135
|
-
|
|
162
|
+
const settings = { baseImage: info.baseImage || null };
|
|
163
|
+
let appId = info.appId;
|
|
164
|
+
if (info.createWebApp) {
|
|
165
|
+
appId = (await app_1.webApps.getOrCreateWebApp(setup.projectId, null, info.serviceId))?.id;
|
|
166
|
+
if (!appId) {
|
|
167
|
+
throw new error_1.FirebaseError(`Couldn't create a Firebase web app for service ${info.serviceId}. Delete an unused web ` +
|
|
168
|
+
`app in the Firebase console, or run "firebase init run" again and pick an existing app.`);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
if (appId) {
|
|
172
|
+
settings.appId = appId;
|
|
173
|
+
}
|
|
174
|
+
await (0, deploy_1.deploy)(["run"], { ...options, projectId: setup.projectId, config, only: `run:${(0, util_1.fullServiceName)(info)}` }, settings);
|
|
136
175
|
}
|
|
137
176
|
function upsertRunConfig(service, config) {
|
|
138
177
|
const entries = getRunEntries(config);
|
package/lib/mcp/index.js
CHANGED
|
@@ -97,7 +97,6 @@ class FirebaseMcpServer {
|
|
|
97
97
|
this.currentLogLevel = params.level;
|
|
98
98
|
return {};
|
|
99
99
|
});
|
|
100
|
-
void this.detectProjectSetup();
|
|
101
100
|
}
|
|
102
101
|
ready() {
|
|
103
102
|
if (this._ready)
|
|
@@ -238,8 +237,19 @@ class FirebaseMcpServer {
|
|
|
238
237
|
}
|
|
239
238
|
_getFirebaseCliCommand() {
|
|
240
239
|
if (!this.cliCommand) {
|
|
241
|
-
|
|
242
|
-
|
|
240
|
+
try {
|
|
241
|
+
const testCommand = crossSpawn.sync(FirebaseMcpServer.DEFAULT_FIREBASE_CLI_COMMAND, ["--version"], {
|
|
242
|
+
timeout: FirebaseMcpServer.CLI_VERSION_CHECK_TIMEOUT_MS,
|
|
243
|
+
stdio: "ignore",
|
|
244
|
+
});
|
|
245
|
+
this.cliCommand =
|
|
246
|
+
testCommand.error || testCommand.status !== 0
|
|
247
|
+
? FirebaseMcpServer.FALLBACK_FIREBASE_CLI_COMMAND
|
|
248
|
+
: FirebaseMcpServer.DEFAULT_FIREBASE_CLI_COMMAND;
|
|
249
|
+
}
|
|
250
|
+
catch {
|
|
251
|
+
this.cliCommand = FirebaseMcpServer.FALLBACK_FIREBASE_CLI_COMMAND;
|
|
252
|
+
}
|
|
243
253
|
}
|
|
244
254
|
return this.cliCommand;
|
|
245
255
|
}
|
|
@@ -391,6 +401,9 @@ class FirebaseMcpServer {
|
|
|
391
401
|
return resolved.result;
|
|
392
402
|
}
|
|
393
403
|
async start(options) {
|
|
404
|
+
void this.detectProjectSetup().catch((err) => {
|
|
405
|
+
this.logger.error(`Failed to detect project setup: ${err instanceof Error ? err.message : String(err)}`);
|
|
406
|
+
});
|
|
394
407
|
if (options?.useSSE) {
|
|
395
408
|
const app = express();
|
|
396
409
|
app.use(cors());
|
|
@@ -492,3 +505,6 @@ class FirebaseMcpServer {
|
|
|
492
505
|
}
|
|
493
506
|
}
|
|
494
507
|
exports.FirebaseMcpServer = FirebaseMcpServer;
|
|
508
|
+
FirebaseMcpServer.CLI_VERSION_CHECK_TIMEOUT_MS = 2000;
|
|
509
|
+
FirebaseMcpServer.DEFAULT_FIREBASE_CLI_COMMAND = "firebase";
|
|
510
|
+
FirebaseMcpServer.FALLBACK_FIREBASE_CLI_COMMAND = "npx firebase-tools@latest";
|