firebase-tools 13.14.0 → 13.14.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/bin/firebase.js
CHANGED
|
@@ -105,8 +105,12 @@ process.on("exit", (code) => {
|
|
|
105
105
|
configstore_1.configstore.delete("lastError");
|
|
106
106
|
}
|
|
107
107
|
try {
|
|
108
|
+
const installMethod = !process.env.FIREPIT_VERSION ? "npm" : "automatic script";
|
|
109
|
+
const updateCommand = !process.env.FIREPIT_VERSION
|
|
110
|
+
? "npm install -g firebase-tools"
|
|
111
|
+
: "curl -sL https://firebase.tools | upgrade=true bash";
|
|
108
112
|
const updateMessage = `Update available ${clc.gray("{currentVersion}")} → ${clc.green("{latestVersion}")}\n` +
|
|
109
|
-
`To update to the latest version using
|
|
113
|
+
`To update to the latest version using ${installMethod}, run\n${clc.cyan(updateCommand)}\n` +
|
|
110
114
|
`For other CLI management options, visit the ${(0, marked_1.marked)("[CLI documentation](https://firebase.google.com/docs/cli#update-cli)")}`;
|
|
111
115
|
updateNotifier.notify({ defer: false, isGlobal: true, message: updateMessage });
|
|
112
116
|
}
|
package/lib/commands/help.js
CHANGED
|
@@ -24,4 +24,6 @@ exports.command = new command_1.Command("help [command]")
|
|
|
24
24
|
logger_1.logger.info(" To get help with a specific command, type", clc.bold("firebase help [command_name]"));
|
|
25
25
|
logger_1.logger.info();
|
|
26
26
|
}
|
|
27
|
+
logger_1.logger.info(" Privacy Policy: https://firebase.google.com/support/privacy");
|
|
28
|
+
logger_1.logger.info();
|
|
27
29
|
});
|
package/lib/commands/init.js
CHANGED
|
@@ -44,8 +44,9 @@ const choices = [
|
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
value: "hosting:github",
|
|
47
|
-
name: "
|
|
47
|
+
name: "Hosting: Set up GitHub Action deploys",
|
|
48
48
|
checked: false,
|
|
49
|
+
hidden: true,
|
|
49
50
|
},
|
|
50
51
|
{
|
|
51
52
|
value: "storage",
|
|
@@ -67,6 +68,17 @@ const choices = [
|
|
|
67
68
|
name: "Extensions: Set up an empty Extensions manifest",
|
|
68
69
|
checked: false,
|
|
69
70
|
},
|
|
71
|
+
{
|
|
72
|
+
value: "dataconnect",
|
|
73
|
+
name: "Data Connect: Set up a Firebase Data Connect service",
|
|
74
|
+
checked: false,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
value: "dataconnect:sdk",
|
|
78
|
+
name: "Data Connect: Set up a generated SDK for your Firebase Data Connect service",
|
|
79
|
+
checked: false,
|
|
80
|
+
hidden: true,
|
|
81
|
+
},
|
|
70
82
|
];
|
|
71
83
|
if ((0, experiments_1.isEnabled)("genkit")) {
|
|
72
84
|
choices.push({
|
|
@@ -75,16 +87,6 @@ if ((0, experiments_1.isEnabled)("genkit")) {
|
|
|
75
87
|
checked: false,
|
|
76
88
|
});
|
|
77
89
|
}
|
|
78
|
-
choices.push({
|
|
79
|
-
value: "dataconnect",
|
|
80
|
-
name: "Data Connect: Set up a Firebase Data Connect service",
|
|
81
|
-
checked: false,
|
|
82
|
-
});
|
|
83
|
-
choices.push({
|
|
84
|
-
value: "dataconnect:sdk",
|
|
85
|
-
name: " └── Data Connect: Set up a generated SDK for your Firebase Data Connect service",
|
|
86
|
-
checked: false,
|
|
87
|
-
});
|
|
88
90
|
const featureNames = choices.map((choice) => choice.value);
|
|
89
91
|
const DESCRIPTION = `Interactively configure the current directory as a Firebase project or initialize new features in an already configured Firebase project directory.
|
|
90
92
|
|
|
@@ -165,7 +167,7 @@ function initAction(feature, options) {
|
|
|
165
167
|
name: "features",
|
|
166
168
|
message: "Which Firebase features do you want to set up for this directory? " +
|
|
167
169
|
"Press Space to select features, then Enter to confirm your choices.",
|
|
168
|
-
choices: choices,
|
|
170
|
+
choices: choices.filter((c) => !c.hidden),
|
|
169
171
|
},
|
|
170
172
|
]);
|
|
171
173
|
})
|
|
@@ -26,8 +26,9 @@ class DataConnectEmulator {
|
|
|
26
26
|
this.emulatorClient = new DataConnectEmulatorClient();
|
|
27
27
|
}
|
|
28
28
|
async start() {
|
|
29
|
+
let resolvedConfigDir;
|
|
29
30
|
try {
|
|
30
|
-
|
|
31
|
+
resolvedConfigDir = this.args.config.path(this.args.configDir);
|
|
31
32
|
const info = await DataConnectEmulator.build({ configDir: resolvedConfigDir });
|
|
32
33
|
if ((0, types_2.requiresVector)(info.metadata)) {
|
|
33
34
|
if (constants_1.Constants.isDemoProject(this.args.projectId)) {
|
|
@@ -51,7 +52,7 @@ class DataConnectEmulator {
|
|
|
51
52
|
await (0, downloadableEmulators_1.start)(types_1.Emulators.DATACONNECT, {
|
|
52
53
|
auto_download: this.args.auto_download,
|
|
53
54
|
listen: (0, portUtils_1.listenSpecsToString)(this.args.listen),
|
|
54
|
-
config_dir:
|
|
55
|
+
config_dir: resolvedConfigDir,
|
|
55
56
|
});
|
|
56
57
|
this.usingExistingEmulator = false;
|
|
57
58
|
}
|
|
@@ -46,20 +46,20 @@ const EMULATOR_UPDATE_DETAILS = {
|
|
|
46
46
|
},
|
|
47
47
|
dataconnect: process.platform === "darwin"
|
|
48
48
|
? {
|
|
49
|
-
version: "1.3.
|
|
49
|
+
version: "1.3.1",
|
|
50
50
|
expectedSize: 24175424,
|
|
51
|
-
expectedChecksum: "
|
|
51
|
+
expectedChecksum: "9ce1ee2ed6994ca62df6dfef3fdece62",
|
|
52
52
|
}
|
|
53
53
|
: process.platform === "win32"
|
|
54
54
|
? {
|
|
55
|
-
version: "1.3.
|
|
56
|
-
expectedSize:
|
|
57
|
-
expectedChecksum: "
|
|
55
|
+
version: "1.3.1",
|
|
56
|
+
expectedSize: 24587264,
|
|
57
|
+
expectedChecksum: "1d31fd26506cfc9b822fdb8e8834d14c",
|
|
58
58
|
}
|
|
59
59
|
: {
|
|
60
|
-
version: "1.3.
|
|
61
|
-
expectedSize:
|
|
62
|
-
expectedChecksum: "
|
|
60
|
+
version: "1.3.1",
|
|
61
|
+
expectedSize: 24088728,
|
|
62
|
+
expectedChecksum: "223f7eebde618ba92788579dd35fec43",
|
|
63
63
|
},
|
|
64
64
|
};
|
|
65
65
|
exports.DownloadDetails = {
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.doSetup = void 0;
|
|
3
|
+
exports.actuate = exports.doSetup = void 0;
|
|
4
4
|
const yaml = require("yaml");
|
|
5
|
-
const fs = require("fs
|
|
5
|
+
const fs = require("fs");
|
|
6
6
|
const clc = require("colorette");
|
|
7
7
|
const prompt_1 = require("../../../prompt");
|
|
8
8
|
const fileUtils_1 = require("../../../dataconnect/fileUtils");
|
|
9
9
|
const load_1 = require("../../../dataconnect/load");
|
|
10
10
|
const logger_1 = require("../../../logger");
|
|
11
11
|
const dataconnectEmulator_1 = require("../../../emulator/dataconnectEmulator");
|
|
12
|
+
const error_1 = require("../../../error");
|
|
12
13
|
const IOS = "ios";
|
|
13
14
|
const WEB = "web";
|
|
14
15
|
const ANDROID = "android";
|
|
15
16
|
async function doSetup(setup, config) {
|
|
17
|
+
const sdkInfo = await askQuestions(setup, config);
|
|
18
|
+
await actuate(sdkInfo, setup.projectId);
|
|
19
|
+
}
|
|
20
|
+
exports.doSetup = doSetup;
|
|
21
|
+
async function askQuestions(setup, config) {
|
|
16
22
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
17
23
|
const serviceCfgs = (0, fileUtils_1.readFirebaseJson)(config);
|
|
18
24
|
const serviceInfos = await Promise.all(serviceCfgs.map((c) => (0, load_1.load)(setup.projectId || "", config, c.source)));
|
|
@@ -27,8 +33,7 @@ async function doSetup(setup, config) {
|
|
|
27
33
|
})
|
|
28
34
|
.flat();
|
|
29
35
|
if (!connectorChoices.length) {
|
|
30
|
-
|
|
31
|
-
return;
|
|
36
|
+
throw new error_1.FirebaseError(`Your config has no connectors to set up SDKs for. Run ${clc.bold("firebase init dataconnect")} to set up a service and conenctors.`);
|
|
32
37
|
}
|
|
33
38
|
const connectorInfo = await (0, prompt_1.promptOnce)({
|
|
34
39
|
message: "Which connector do you want set up a generated SDK for?",
|
|
@@ -102,20 +107,24 @@ async function doSetup(setup, config) {
|
|
|
102
107
|
};
|
|
103
108
|
newConnectorYaml.generate.kotlinSdk = kotlinSdk;
|
|
104
109
|
}
|
|
105
|
-
const
|
|
106
|
-
const connectorYamlPath = `${connectorInfo.directory}/connector.yaml`;
|
|
107
|
-
fs.writeFileSync(connectorYamlPath, connectorYamlContents, "utf8");
|
|
108
|
-
logger_1.logger.info(`Wrote new config to ${connectorYamlPath}`);
|
|
109
|
-
if (setup.projectId &&
|
|
110
|
+
const shouldGenerate = !!(setup.projectId &&
|
|
110
111
|
(await (0, prompt_1.confirm)({
|
|
111
112
|
message: "Would you like to generate SDK code now?",
|
|
112
113
|
default: true,
|
|
113
|
-
})))
|
|
114
|
+
})));
|
|
115
|
+
const connectorYamlContents = yaml.stringify(newConnectorYaml);
|
|
116
|
+
return { connectorYamlContents, connectorInfo, shouldGenerate };
|
|
117
|
+
}
|
|
118
|
+
async function actuate(sdkInfo, projectId) {
|
|
119
|
+
const connectorYamlPath = `${sdkInfo.connectorInfo.directory}/connector.yaml`;
|
|
120
|
+
fs.writeFileSync(connectorYamlPath, sdkInfo.connectorYamlContents, "utf8");
|
|
121
|
+
logger_1.logger.info(`Wrote new config to ${connectorYamlPath}`);
|
|
122
|
+
if (projectId && sdkInfo.shouldGenerate) {
|
|
114
123
|
await dataconnectEmulator_1.DataConnectEmulator.generate({
|
|
115
|
-
configDir: connectorInfo.directory,
|
|
116
|
-
connectorId: connectorInfo.connectorYaml.connectorId,
|
|
124
|
+
configDir: sdkInfo.connectorInfo.directory,
|
|
125
|
+
connectorId: sdkInfo.connectorInfo.connectorYaml.connectorId,
|
|
117
126
|
});
|
|
118
|
-
logger_1.logger.info(`Generated SDK code for ${connectorInfo.connectorYaml.connectorId}`);
|
|
127
|
+
logger_1.logger.info(`Generated SDK code for ${sdkInfo.connectorInfo.connectorYaml.connectorId}`);
|
|
119
128
|
}
|
|
120
129
|
}
|
|
121
|
-
exports.
|
|
130
|
+
exports.actuate = actuate;
|