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 +12 -8
- package/lib/deploy/extensions/prepare.js +6 -0
- package/lib/emulator/downloadableEmulators.js +4 -4
- package/lib/emulator/portUtils.js +3 -3
- package/lib/emulator/registry.js +9 -9
- package/lib/extensions/change-log.js +1 -1
- package/package.json +1 -1
- package/standalone/firepit.js +0 -1
- package/standalone/package.json +1 -1
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([
|
|
@@ -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.
|
|
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",
|
|
@@ -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.
|
|
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) {
|
|
@@ -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 =
|
|
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
package/standalone/firepit.js
CHANGED
|
@@ -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
|
|