firebase-tools 12.5.3 → 12.5.4
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/command.js
CHANGED
|
@@ -83,10 +83,12 @@ class Command {
|
|
|
83
83
|
runner(...args)
|
|
84
84
|
.then(async (result) => {
|
|
85
85
|
if ((0, utils_1.getInheritedOption)(options, "json")) {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
86
|
+
await new Promise((resolve) => {
|
|
87
|
+
process.stdout.write(JSON.stringify({
|
|
88
|
+
status: "success",
|
|
89
|
+
result: result,
|
|
90
|
+
}, null, 2), resolve);
|
|
91
|
+
});
|
|
90
92
|
}
|
|
91
93
|
const duration = Math.floor((process.uptime() - start) * 1000);
|
|
92
94
|
const trackSuccess = (0, track_1.trackGA4)("command_execution", {
|
|
@@ -111,10 +113,12 @@ class Command {
|
|
|
111
113
|
})
|
|
112
114
|
.catch(async (err) => {
|
|
113
115
|
if ((0, utils_1.getInheritedOption)(options, "json")) {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
await new Promise((resolve) => {
|
|
117
|
+
process.stdout.write(JSON.stringify({
|
|
118
|
+
status: "error",
|
|
119
|
+
error: err.message,
|
|
120
|
+
}, null, 2), resolve);
|
|
121
|
+
});
|
|
118
122
|
}
|
|
119
123
|
const duration = Math.floor((process.uptime() - start) * 1000);
|
|
120
124
|
await (0, utils_1.withTimeout)(5000, Promise.all([
|
|
@@ -23,9 +23,9 @@ const EMULATOR_UPDATE_DETAILS = {
|
|
|
23
23
|
expectedChecksum: "2fd771101c0e1f7898c04c9204f2ce63",
|
|
24
24
|
},
|
|
25
25
|
firestore: {
|
|
26
|
-
version: "1.18.
|
|
27
|
-
expectedSize:
|
|
28
|
-
expectedChecksum: "
|
|
26
|
+
version: "1.18.2",
|
|
27
|
+
expectedSize: 63929486,
|
|
28
|
+
expectedChecksum: "7b066cd684baf9bcd4a56a258be344a5",
|
|
29
29
|
},
|
|
30
30
|
storage: {
|
|
31
31
|
version: "1.1.3",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveHostAndAssignPorts = exports.
|
|
3
|
+
exports.resolveHostAndAssignPorts = exports.waitForPortUsed = exports.checkListenable = void 0;
|
|
4
4
|
const clc = require("colorette");
|
|
5
5
|
const tcpport = require("tcp-port-used");
|
|
6
6
|
const node_net_1 = require("node:net");
|
|
@@ -131,7 +131,7 @@ async function checkListenable(arg1, port) {
|
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
133
|
exports.checkListenable = checkListenable;
|
|
134
|
-
async function
|
|
134
|
+
async function waitForPortUsed(port, host) {
|
|
135
135
|
const interval = 250;
|
|
136
136
|
const timeout = 60000;
|
|
137
137
|
try {
|
|
@@ -141,7 +141,7 @@ async function waitForPortClosed(port, host) {
|
|
|
141
141
|
throw new error_1.FirebaseError(`TIMEOUT: Port ${port} on ${host} was not active within ${timeout}ms`);
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
exports.
|
|
144
|
+
exports.waitForPortUsed = waitForPortUsed;
|
|
145
145
|
const EMULATOR_CAN_LISTEN_ON_PRIMARY_ONLY = {
|
|
146
146
|
database: true,
|
|
147
147
|
firestore: true,
|
package/lib/emulator/registry.js
CHANGED
|
@@ -18,7 +18,7 @@ class EmulatorRegistry {
|
|
|
18
18
|
await instance.start();
|
|
19
19
|
if (instance.getName() !== types_1.Emulators.EXTENSIONS) {
|
|
20
20
|
const info = instance.getInfo();
|
|
21
|
-
await portUtils.
|
|
21
|
+
await portUtils.waitForPortUsed(info.port, (0, utils_1.connectableHostname)(info.host));
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
static async stop(name) {
|
|
@@ -27,8 +27,13 @@ class EmulatorRegistry {
|
|
|
27
27
|
if (!instance) {
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
try {
|
|
31
|
+
await instance.stop();
|
|
32
|
+
this.clear(instance.getName());
|
|
33
|
+
}
|
|
34
|
+
catch (e) {
|
|
35
|
+
emulatorLogger_1.EmulatorLogger.forEmulator(name).logLabeled("WARN", name, `Error stopping ${constants_1.Constants.description(name)}`);
|
|
36
|
+
}
|
|
32
37
|
}
|
|
33
38
|
static async stopAll() {
|
|
34
39
|
const stopPriority = {
|
|
@@ -49,12 +54,7 @@ class EmulatorRegistry {
|
|
|
49
54
|
return stopPriority[a] - stopPriority[b];
|
|
50
55
|
});
|
|
51
56
|
for (const name of emulatorsToStop) {
|
|
52
|
-
|
|
53
|
-
await this.stop(name);
|
|
54
|
-
}
|
|
55
|
-
catch (e) {
|
|
56
|
-
emulatorLogger_1.EmulatorLogger.forEmulator(name).logLabeled("WARN", name, `Error stopping ${constants_1.Constants.description(name)}`);
|
|
57
|
-
}
|
|
57
|
+
await this.stop(name);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
static isRunning(emulator) {
|