firebase-tools 13.31.1 → 13.31.2
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/dataconnect/build.js +7 -7
- package/lib/dataconnect/graphqlError.js +36 -9
- package/lib/emulator/apphosting/serve.js +3 -2
- package/lib/emulator/dataconnect/pgliteServer.js +3 -0
- package/lib/emulator/dataconnectEmulator.js +1 -1
- package/lib/emulator/downloadableEmulators.js +9 -9
- package/package.json +1 -1
package/lib/dataconnect/build.js
CHANGED
|
@@ -34,7 +34,7 @@ async function handleBuildErrors(errors, nonInteractive, force, dryRun) {
|
|
|
34
34
|
const requiredForces = errors.filter((w) => { var _a; return ((_a = w.extensions) === null || _a === void 0 ? void 0 : _a.warningLevel) === "REQUIRE_FORCE"; });
|
|
35
35
|
if (requiredForces.length && !force) {
|
|
36
36
|
utils.logLabeledError("dataconnect", `There are changes in your schema or connectors that will result in broken behavior:\n` +
|
|
37
|
-
(0, graphqlError_1.
|
|
37
|
+
(0, graphqlError_1.prettifyTable)(requiredForces));
|
|
38
38
|
throw new error_1.FirebaseError("Rerun this command with --force to deploy these changes.");
|
|
39
39
|
}
|
|
40
40
|
const interactiveAcks = errors.filter((w) => { var _a; return ((_a = w.extensions) === null || _a === void 0 ? void 0 : _a.warningLevel) === "INTERACTIVE_ACK"; });
|
|
@@ -44,14 +44,14 @@ async function handleBuildErrors(errors, nonInteractive, force, dryRun) {
|
|
|
44
44
|
{ name: "Reject changes and abort", value: "abort" },
|
|
45
45
|
];
|
|
46
46
|
if (requiredAcks.length) {
|
|
47
|
-
utils.logLabeledWarning("dataconnect", `There are changes in your schema or connectors that may break your existing applications. These changes require explicit acknowledgement to proceed. You may either reject the changes and update your sources with the suggested workaround(s), if any, or acknowledge these changes and proceed with the deployment:\n` +
|
|
48
|
-
(0, graphqlError_1.
|
|
47
|
+
utils.logLabeledWarning("dataconnect", `There are changes in your schema or connectors that may break your existing applications or introduce operations that are insecure. These changes require explicit acknowledgement to proceed. You may either reject the changes and update your sources with the suggested workaround(s), if any, or acknowledge these changes and proceed with the deployment:\n` +
|
|
48
|
+
(0, graphqlError_1.prettifyTable)(requiredAcks));
|
|
49
49
|
if (nonInteractive && !force) {
|
|
50
|
-
throw new error_1.FirebaseError("Explicit acknowledgement required for breaking schema or connector changes. Rerun this command with --force to deploy these changes.");
|
|
50
|
+
throw new error_1.FirebaseError("Explicit acknowledgement required for breaking schema or connector changes and new insecure operations. Rerun this command with --force to deploy these changes.");
|
|
51
51
|
}
|
|
52
52
|
else if (!nonInteractive && !force && !dryRun) {
|
|
53
53
|
const result = await (0, prompt_1.promptOnce)({
|
|
54
|
-
message: "Would you like to proceed with these
|
|
54
|
+
message: "Would you like to proceed with these changes?",
|
|
55
55
|
type: "list",
|
|
56
56
|
choices,
|
|
57
57
|
default: "abort",
|
|
@@ -62,8 +62,8 @@ async function handleBuildErrors(errors, nonInteractive, force, dryRun) {
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
if (interactiveAcks.length) {
|
|
65
|
-
utils.logLabeledWarning("dataconnect", `There are changes in your schema or connectors that may cause unexpected behavior in your existing applications:\n` +
|
|
66
|
-
|
|
65
|
+
utils.logLabeledWarning("dataconnect", `There are existing insecure operations or changes in your schema or connectors that may cause unexpected behavior in your existing applications:\n` +
|
|
66
|
+
(0, graphqlError_1.prettifyTable)(interactiveAcks));
|
|
67
67
|
if (!nonInteractive && !force && !dryRun) {
|
|
68
68
|
const result = await (0, prompt_1.promptOnce)({
|
|
69
69
|
message: "Would you like to proceed with these changes?",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.prettifyTable = exports.prettify = void 0;
|
|
4
4
|
const Table = require("cli-table3");
|
|
5
5
|
function prettify(err) {
|
|
6
6
|
var _a, _b, _c, _d;
|
|
7
|
-
|
|
7
|
+
let message = err.message;
|
|
8
8
|
let header = (_b = (_a = err.extensions) === null || _a === void 0 ? void 0 : _a.file) !== null && _b !== void 0 ? _b : "";
|
|
9
9
|
if (err.locations && err.locations.length) {
|
|
10
10
|
const line = (_d = (_c = err.locations[0]) === null || _c === void 0 ? void 0 : _c.line) !== null && _d !== void 0 ? _d : "";
|
|
@@ -12,33 +12,60 @@ function prettify(err) {
|
|
|
12
12
|
header += `:${line}`;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
+
if (err.path && err.path.length) {
|
|
16
|
+
let pathStr = "On ";
|
|
17
|
+
for (let i = 0; i < err.path.length; i++) {
|
|
18
|
+
if (typeof err.path[i] === "string") {
|
|
19
|
+
if (i === 0) {
|
|
20
|
+
pathStr += err.path[i];
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
pathStr = `${pathStr}.${err.path[i]}`;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
pathStr = `${pathStr}[${err.path[i]}]`;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
message = `${pathStr}: ${message}`;
|
|
31
|
+
}
|
|
15
32
|
return header.length ? `${header}: ${message}` : message;
|
|
16
33
|
}
|
|
17
34
|
exports.prettify = prettify;
|
|
18
|
-
function
|
|
35
|
+
function splitIssueMessage(err) {
|
|
36
|
+
const msg = err.message.split(": ");
|
|
37
|
+
if (msg.length >= 2) {
|
|
38
|
+
return [msg[0], msg.slice(1).join(":")];
|
|
39
|
+
}
|
|
40
|
+
return ["", err.message];
|
|
41
|
+
}
|
|
42
|
+
function prettifyTable(errs) {
|
|
19
43
|
var _a, _b;
|
|
20
44
|
const table = new Table({
|
|
21
|
-
head: ["Issue", "Workaround", "Reason"],
|
|
45
|
+
head: ["Type", "Issue", "Workaround", "Reason"],
|
|
22
46
|
style: { head: ["yellow"] },
|
|
23
|
-
colWidths: [50, 50, 50],
|
|
47
|
+
colWidths: [20, 50, 50, 50],
|
|
24
48
|
wordWrap: true,
|
|
25
49
|
});
|
|
50
|
+
errs.sort((a, b) => a.message.localeCompare(b.message));
|
|
26
51
|
for (const e of errs) {
|
|
52
|
+
const msg = splitIssueMessage(e);
|
|
53
|
+
e.message = msg[1];
|
|
27
54
|
if (!((_b = (_a = e.extensions) === null || _a === void 0 ? void 0 : _a.workarounds) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
28
|
-
table.push([prettify(e), "", ""]);
|
|
55
|
+
table.push([msg[0], prettify(e), "", ""]);
|
|
29
56
|
}
|
|
30
57
|
else {
|
|
31
58
|
const workarounds = e.extensions.workarounds;
|
|
32
59
|
for (let i = 0; i < workarounds.length; i++) {
|
|
33
60
|
if (i === 0) {
|
|
34
|
-
table.push([prettify(e), workarounds[i].description, workarounds[i].reason]);
|
|
61
|
+
table.push([msg[0], prettify(e), workarounds[i].description, workarounds[i].reason]);
|
|
35
62
|
}
|
|
36
63
|
else {
|
|
37
|
-
table.push(["", workarounds[i].description, workarounds[i].reason]);
|
|
64
|
+
table.push(["", "", workarounds[i].description, workarounds[i].reason]);
|
|
38
65
|
}
|
|
39
66
|
}
|
|
40
67
|
}
|
|
41
68
|
}
|
|
42
69
|
return table.toString();
|
|
43
70
|
}
|
|
44
|
-
exports.
|
|
71
|
+
exports.prettifyTable = prettifyTable;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.start = void 0;
|
|
3
|
+
exports.getEmulatorEnvs = exports.start = void 0;
|
|
4
4
|
const net_1 = require("net");
|
|
5
5
|
const portUtils_1 = require("../portUtils");
|
|
6
6
|
const developmentServer_1 = require("./developmentServer");
|
|
@@ -50,7 +50,8 @@ function availablePort(host, port) {
|
|
|
50
50
|
}
|
|
51
51
|
function getEmulatorEnvs() {
|
|
52
52
|
const envs = {};
|
|
53
|
-
const emulatorInfos = registry_1.EmulatorRegistry.listRunningWithInfo();
|
|
53
|
+
const emulatorInfos = registry_1.EmulatorRegistry.listRunningWithInfo().filter((emulator) => emulator.name !== types_1.Emulators.APPHOSTING);
|
|
54
54
|
(0, env_1.setEnvVarsForEmulators)(envs, emulatorInfos);
|
|
55
55
|
return envs;
|
|
56
56
|
}
|
|
57
|
+
exports.getEmulatorEnvs = getEmulatorEnvs;
|
|
@@ -79,6 +79,9 @@ class PostgresServer {
|
|
|
79
79
|
}
|
|
80
80
|
async getDb() {
|
|
81
81
|
if (!this.db) {
|
|
82
|
+
if (this.dataDirectory && !fs.existsSync(this.dataDirectory)) {
|
|
83
|
+
fs.mkdirSync(this.dataDirectory, { recursive: true });
|
|
84
|
+
}
|
|
82
85
|
const vector = (await dynamicImport("@electric-sql/pglite/vector")).vector;
|
|
83
86
|
const uuidOssp = (await dynamicImport("@electric-sql/pglite/contrib/uuid_ossp")).uuid_ossp;
|
|
84
87
|
const pgliteArgs = {
|
|
@@ -70,7 +70,7 @@ class DataConnectEmulator {
|
|
|
70
70
|
dataDirectory = this.args.config.path(dataDirectory);
|
|
71
71
|
}
|
|
72
72
|
const postgresDumpPath = this.args.importPath
|
|
73
|
-
? path.join(this.args.
|
|
73
|
+
? path.join(this.args.importPath, "postgres.tar.gz")
|
|
74
74
|
: undefined;
|
|
75
75
|
this.postgresServer = new pgliteServer_1.PostgresServer({
|
|
76
76
|
dataDirectory,
|
|
@@ -48,20 +48,20 @@ const EMULATOR_UPDATE_DETAILS = {
|
|
|
48
48
|
},
|
|
49
49
|
dataconnect: process.platform === "darwin"
|
|
50
50
|
? {
|
|
51
|
-
version: "1.8.
|
|
52
|
-
expectedSize:
|
|
53
|
-
expectedChecksum: "
|
|
51
|
+
version: "1.8.2",
|
|
52
|
+
expectedSize: 25506560,
|
|
53
|
+
expectedChecksum: "2db676cb9d30b289897ffb7e5aa1ef63",
|
|
54
54
|
}
|
|
55
55
|
: process.platform === "win32"
|
|
56
56
|
? {
|
|
57
|
-
version: "1.8.
|
|
58
|
-
expectedSize:
|
|
59
|
-
expectedChecksum: "
|
|
57
|
+
version: "1.8.2",
|
|
58
|
+
expectedSize: 25936384,
|
|
59
|
+
expectedChecksum: "08e6ca0ad20893b565fb57effd687eb8",
|
|
60
60
|
}
|
|
61
61
|
: {
|
|
62
|
-
version: "1.8.
|
|
63
|
-
expectedSize:
|
|
64
|
-
expectedChecksum: "
|
|
62
|
+
version: "1.8.2",
|
|
63
|
+
expectedSize: 25415832,
|
|
64
|
+
expectedChecksum: "24e0eb78acb619ed91f6d268dd18df05",
|
|
65
65
|
},
|
|
66
66
|
};
|
|
67
67
|
exports.DownloadDetails = {
|