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
- console.log(JSON.stringify({
87
- status: "success",
88
- result: result,
89
- }, null, 2));
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
- console.log(JSON.stringify({
115
- status: "error",
116
- error: err.message,
117
- }, null, 2));
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.1",
27
- expectedSize: 64866257,
28
- expectedChecksum: "743211a3e33217fe71dc20aff1fa26a5",
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.waitForPortClosed = exports.checkListenable = void 0;
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 waitForPortClosed(port, host) {
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.waitForPortClosed = waitForPortClosed;
144
+ exports.waitForPortUsed = waitForPortUsed;
145
145
  const EMULATOR_CAN_LISTEN_ON_PRIMARY_ONLY = {
146
146
  database: true,
147
147
  firestore: true,
@@ -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.waitForPortClosed(info.port, (0, utils_1.connectableHostname)(info.host));
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
- await instance.stop();
31
- this.clear(instance.getName());
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
- try {
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firebase-tools",
3
- "version": "12.5.3",
3
+ "version": "12.5.4",
4
4
  "description": "Command-Line Interface for Firebase",
5
5
  "main": "./lib/index.js",
6
6
  "bin": {