firebase-tools 12.5.2 → 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([
@@ -38,6 +38,8 @@ async function prepare(context, options, payload) {
38
38
  if (!(await prompt.confirm({
39
39
  message: `Do you wish to continue deploying these extension instances?`,
40
40
  default: false,
41
+ nonInteractive: options.nonInteractive,
42
+ force: options.force,
41
43
  }))) {
42
44
  throw new error_1.FirebaseError("Deployment cancelled");
43
45
  }
@@ -58,6 +60,8 @@ async function prepare(context, options, payload) {
58
60
  if (!(await prompt.confirm({
59
61
  message: `Do you wish to continue deploying these extension instances?`,
60
62
  default: true,
63
+ nonInteractive: options.nonInteractive,
64
+ force: options.force,
61
65
  }))) {
62
66
  throw new error_1.FirebaseError("Deployment cancelled");
63
67
  }
@@ -82,6 +86,8 @@ async function prepare(context, options, payload) {
82
86
  .map((i) => i.instanceId)
83
87
  .join(", ")}?`,
84
88
  default: false,
89
+ nonInteractive: options.nonInteractive,
90
+ force: options.force,
85
91
  }))) {
86
92
  payload.instancesToDelete = [];
87
93
  }
@@ -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",
@@ -333,7 +333,7 @@ async function stop(targetName) {
333
333
  const emulator = get(targetName);
334
334
  return new Promise((resolve, reject) => {
335
335
  const logger = emulatorLogger_1.EmulatorLogger.forEmulator(emulator.name);
336
- if (emulator.instance) {
336
+ if (emulator.instance && emulator.instance.kill(0)) {
337
337
  const killTimeout = setTimeout(() => {
338
338
  const pid = emulator.instance ? emulator.instance.pid : -1;
339
339
  const errorMsg = constants_1.Constants.description(emulator.name) + ": Unable to terminate process (PID=" + pid + ")";
@@ -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) {
@@ -16,7 +16,7 @@ marked_1.marked.setOptions({
16
16
  renderer: new TerminalRenderer(),
17
17
  });
18
18
  const EXTENSIONS_CHANGELOG = "CHANGELOG.md";
19
- const VERSION_LINE_REGEX = /##.*(\d+\.\d+\.\d+(?:-((\d+|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(\d+|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?).*/;
19
+ const VERSION_LINE_REGEX = /##.+?(\d+\.\d+\.\d+(?:-((\d+|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(\d+|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?).*/;
20
20
  async function getReleaseNotesForUpdate(args) {
21
21
  const releaseNotes = {};
22
22
  const filter = `id<="${args.toVersion}" AND id>"${args.fromVersion}"`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firebase-tools",
3
- "version": "12.5.2",
3
+ "version": "12.5.4",
4
4
  "description": "Command-Line Interface for Firebase",
5
5
  "main": "./lib/index.js",
6
6
  "bin": {
@@ -184,7 +184,6 @@ let runtimeBinsPath = path.join(homePath, ".cache", "firebase", "runtime");
184
184
  const npmArgs = [
185
185
  `--script-shell=${runtimeBinsPath}/shell${isWindows ? ".bat" : ""}`,
186
186
  `--globalconfig=${path.join(runtimeBinsPath, "npmrc")}`,
187
- `--userconfig=${path.join(runtimeBinsPath, "npmrc")}`,
188
187
  `--scripts-prepend-node-path=auto`
189
188
  ];
190
189
 
@@ -12,7 +12,7 @@
12
12
  "license": "MIT",
13
13
  "dependencies": {
14
14
  "chalk": "^2.4.2",
15
- "npm": "^9.8.0",
15
+ "npm": "^8.19.0",
16
16
  "shelljs": "^0.8.3",
17
17
  "shx": "^0.3.2",
18
18
  "user-home": "^2.0.0"