firebase-tools 9.23.2 → 10.0.0
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/CHANGELOG.md +5 -7
- package/lib/api.js +0 -1
- package/lib/commands/database-remove.js +2 -2
- package/lib/commands/database-set.js +2 -2
- package/lib/commands/database-update.js +2 -2
- package/lib/commands/firestore-delete.js +2 -2
- package/lib/commands/hosting-disable.js +3 -3
- package/lib/deploy/functions/deploy.js +6 -7
- package/lib/deploy/functions/release/index.js +1 -1
- package/lib/deploy/functions/runtimes/node/parseRuntimeAndValidateSDK.js +1 -1
- package/lib/emulator/functionsEmulatorRuntime.js +1 -1
- package/package.json +2 -2
- package/templates/init/functions/javascript/package.lint.json +1 -1
- package/templates/init/functions/javascript/package.nolint.json +1 -1
- package/templates/init/functions/typescript/package.lint.json +1 -1
- package/templates/init/functions/typescript/package.nolint.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
-
|
|
2
|
-
-
|
|
3
|
-
-
|
|
4
|
-
-
|
|
5
|
-
-
|
|
6
|
-
- Fixes issue where `remoteconfig:get` was not fetching the latest version by default. (#3559)
|
|
7
|
-
- Fixes issue where empty variables in .env files would instead read as multi-line values. (#3934)
|
|
1
|
+
- **BREAKING** Drops support for running the CLI on Node 10.
|
|
2
|
+
- **BREAKING** Replaces all usages of `-y`, `--yes`, or `--confirm` with `-f` and `--force`.
|
|
3
|
+
- **BREAKING** Function deploys upload source to the deployed region instead of us-central1.
|
|
4
|
+
- Requires firebase-functions >= 3.13.1 in Functions emulator to include bug fixes (#3851).
|
|
5
|
+
- Updates default functions runtime to Node.js 16.
|
package/lib/api.js
CHANGED
|
@@ -93,7 +93,6 @@ var api = {
|
|
|
93
93
|
functionsOrigin: utils.envOverride("FIREBASE_FUNCTIONS_URL", "https://cloudfunctions.googleapis.com"),
|
|
94
94
|
functionsV2Origin: utils.envOverride("FIREBASE_FUNCTIONS_V2_URL", "https://cloudfunctions.googleapis.com"),
|
|
95
95
|
runOrigin: utils.envOverride("CLOUD_RUN_URL", "https://run.googleapis.com"),
|
|
96
|
-
functionsUploadRegion: utils.envOverride("FIREBASE_FUNCTIONS_UPLOAD_REGION", "us-central1"),
|
|
97
96
|
functionsDefaultRegion: utils.envOverride("FIREBASE_FUNCTIONS_DEFAULT_REGION", "us-central1"),
|
|
98
97
|
cloudschedulerOrigin: utils.envOverride("FIREBASE_CLOUDSCHEDULER_URL", "https://cloudscheduler.googleapis.com"),
|
|
99
98
|
cloudTasksOrigin: utils.envOverride("FIREBASE_CLOUD_TAKS_URL", "https://cloudtasks.googleapis.com"),
|
|
@@ -14,7 +14,7 @@ const clc = require("cli-color");
|
|
|
14
14
|
const _ = require("lodash");
|
|
15
15
|
module.exports = new command_1.Command("database:remove <path>")
|
|
16
16
|
.description("remove data from your Firebase at the specified path")
|
|
17
|
-
.option("-
|
|
17
|
+
.option("-f, --force", "pass this option to bypass confirmation prompt")
|
|
18
18
|
.option("--instance <instance>", "use the database <instance>.firebaseio.com (if omitted, use default database instance)")
|
|
19
19
|
.before(requirePermissions_1.requirePermissions, ["firebasedatabase.instances.update"])
|
|
20
20
|
.before(requireDatabaseInstance_1.requireDatabaseInstance)
|
|
@@ -28,7 +28,7 @@ module.exports = new command_1.Command("database:remove <path>")
|
|
|
28
28
|
const databaseUrl = utils.getDatabaseUrl(origin, options.instance, path);
|
|
29
29
|
const confirm = await prompt_1.promptOnce({
|
|
30
30
|
type: "confirm",
|
|
31
|
-
name: "
|
|
31
|
+
name: "force",
|
|
32
32
|
default: false,
|
|
33
33
|
message: "You are about to remove all data at " + clc.cyan(databaseUrl) + ". Are you sure?",
|
|
34
34
|
}, options);
|
|
@@ -19,7 +19,7 @@ const utils = require("../utils");
|
|
|
19
19
|
exports.default = new command_1.Command("database:set <path> [infile]")
|
|
20
20
|
.description("store JSON data at the specified path via STDIN, arg, or file")
|
|
21
21
|
.option("-d, --data <data>", "specify escaped JSON directly")
|
|
22
|
-
.option("-
|
|
22
|
+
.option("-f, --force", "pass this option to bypass confirmation prompt")
|
|
23
23
|
.option("--instance <instance>", "use the database <instance>.firebaseio.com (if omitted, use default database instance)")
|
|
24
24
|
.before(requirePermissions_1.requirePermissions, ["firebasedatabase.instances.update"])
|
|
25
25
|
.before(requireDatabaseInstance_1.requireDatabaseInstance)
|
|
@@ -34,7 +34,7 @@ exports.default = new command_1.Command("database:set <path> [infile]")
|
|
|
34
34
|
const dbJsonURL = new url_1.URL(utils.getDatabaseUrl(origin, options.instance, path + ".json"));
|
|
35
35
|
const confirm = await prompt_1.promptOnce({
|
|
36
36
|
type: "confirm",
|
|
37
|
-
name: "
|
|
37
|
+
name: "force",
|
|
38
38
|
default: false,
|
|
39
39
|
message: "You are about to overwrite all data at " + clc.cyan(dbPath) + ". Are you sure?",
|
|
40
40
|
}, options);
|
|
@@ -18,7 +18,7 @@ const utils = require("../utils");
|
|
|
18
18
|
exports.default = new command_1.Command("database:update <path> [infile]")
|
|
19
19
|
.description("update some of the keys for the defined path in your Firebase")
|
|
20
20
|
.option("-d, --data <data>", "specify escaped JSON directly")
|
|
21
|
-
.option("-
|
|
21
|
+
.option("-f, --force", "pass this option to bypass confirmation prompt")
|
|
22
22
|
.option("--instance <instance>", "use the database <instance>.firebaseio.com (if omitted, use default database instance)")
|
|
23
23
|
.before(requirePermissions_1.requirePermissions, ["firebasedatabase.instances.update"])
|
|
24
24
|
.before(requireDatabaseInstance_1.requireDatabaseInstance)
|
|
@@ -32,7 +32,7 @@ exports.default = new command_1.Command("database:update <path> [infile]")
|
|
|
32
32
|
const url = utils.getDatabaseUrl(origin, options.instance, path);
|
|
33
33
|
const confirmed = await prompt_1.promptOnce({
|
|
34
34
|
type: "confirm",
|
|
35
|
-
name: "
|
|
35
|
+
name: "force",
|
|
36
36
|
default: false,
|
|
37
37
|
message: `You are about to modify data at ${clc.cyan(url)}. Are you sure?`,
|
|
38
38
|
}, options);
|
|
@@ -54,7 +54,7 @@ module.exports = new command_1.Command("firestore:delete [path]")
|
|
|
54
54
|
"subcollections. May not be passed along with -r.")
|
|
55
55
|
.option("--all-collections", "Delete all. Deletes the entire Firestore database, " +
|
|
56
56
|
"including all collections and documents. Any other flags or arguments will be ignored.")
|
|
57
|
-
.option("-
|
|
57
|
+
.option("-f, --force", "No confirmation. Otherwise, a confirmation prompt will appear.")
|
|
58
58
|
.before(commandUtils_1.printNoticeIfEmulated, types_1.Emulators.FIRESTORE)
|
|
59
59
|
.before(requirePermissions_1.requirePermissions, ["datastore.entities.list", "datastore.entities.delete"])
|
|
60
60
|
.action(async (path, options) => {
|
|
@@ -68,7 +68,7 @@ module.exports = new command_1.Command("firestore:delete [path]")
|
|
|
68
68
|
});
|
|
69
69
|
const confirm = await prompt_1.promptOnce({
|
|
70
70
|
type: "confirm",
|
|
71
|
-
name: "
|
|
71
|
+
name: "force",
|
|
72
72
|
default: false,
|
|
73
73
|
message: getConfirmationMessage(deleteOp, options),
|
|
74
74
|
}, options);
|
|
@@ -10,7 +10,7 @@ const requirePermissions_1 = require("../requirePermissions");
|
|
|
10
10
|
const utils = require("../utils");
|
|
11
11
|
exports.default = new command_1.Command("hosting:disable")
|
|
12
12
|
.description("stop serving web traffic to your Firebase Hosting site")
|
|
13
|
-
.option("-
|
|
13
|
+
.option("-f, --force", "skip confirmation")
|
|
14
14
|
.option("-s, --site <siteName>", "the site to disable")
|
|
15
15
|
.before(requirePermissions_1.requirePermissions, ["firebasehosting.sites.update"])
|
|
16
16
|
.before(requireHostingSite_1.requireHostingSite)
|
|
@@ -18,9 +18,9 @@ exports.default = new command_1.Command("hosting:disable")
|
|
|
18
18
|
const siteToDisable = options.site;
|
|
19
19
|
const confirm = await prompt_1.promptOnce({
|
|
20
20
|
type: "confirm",
|
|
21
|
-
name: "
|
|
21
|
+
name: "force",
|
|
22
22
|
message: `Are you sure you want to disable Firebase Hosting for the site ${clc.underline(siteToDisable)}\n${clc.underline("This will immediately make your site inaccessible!")}`,
|
|
23
|
-
});
|
|
23
|
+
}, options);
|
|
24
24
|
if (!confirm) {
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
@@ -5,18 +5,16 @@ const tmp_1 = require("tmp");
|
|
|
5
5
|
const clc = require("cli-color");
|
|
6
6
|
const fs = require("fs");
|
|
7
7
|
const checkIam_1 = require("./checkIam");
|
|
8
|
-
const api_1 = require("../../api");
|
|
9
8
|
const utils_1 = require("../../utils");
|
|
10
9
|
const gcs = require("../../gcp/storage");
|
|
11
10
|
const gcf = require("../../gcp/cloudfunctions");
|
|
12
11
|
const gcfv2 = require("../../gcp/cloudfunctionsv2");
|
|
13
12
|
const utils = require("../../utils");
|
|
14
13
|
const backend = require("./backend");
|
|
15
|
-
const GCP_REGION = api_1.functionsUploadRegion;
|
|
16
14
|
tmp_1.setGracefulCleanup();
|
|
17
|
-
async function uploadSourceV1(context) {
|
|
18
|
-
const uploadUrl = await gcf.generateUploadUrl(context.projectId,
|
|
19
|
-
context.
|
|
15
|
+
async function uploadSourceV1(context, region) {
|
|
16
|
+
const uploadUrl = await gcf.generateUploadUrl(context.projectId, region);
|
|
17
|
+
context.sourceUrl = uploadUrl;
|
|
20
18
|
const uploadOpts = {
|
|
21
19
|
file: context.functionsSourceV1,
|
|
22
20
|
stream: fs.createReadStream(context.functionsSourceV1),
|
|
@@ -45,8 +43,9 @@ async function deploy(context, options, payload) {
|
|
|
45
43
|
try {
|
|
46
44
|
const want = payload.functions.backend;
|
|
47
45
|
const uploads = [];
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
const v1Endpoints = backend.allEndpoints(want).filter((e) => e.platform === "gcfv1");
|
|
47
|
+
if (v1Endpoints.length > 0) {
|
|
48
|
+
uploads.push(uploadSourceV1(context, v1Endpoints[0].region));
|
|
50
49
|
}
|
|
51
50
|
for (const region of Object.keys(want.endpoints)) {
|
|
52
51
|
if (backend.regionalEndpoints(want, region).some((e) => e.platform === "gcfv2")) {
|
|
@@ -37,7 +37,7 @@ async function release(context, options, payload) {
|
|
|
37
37
|
const fab = new fabricator.Fabricator({
|
|
38
38
|
functionExecutor,
|
|
39
39
|
executor: new executor.QueueExecutor({}),
|
|
40
|
-
sourceUrl: context.
|
|
40
|
+
sourceUrl: context.sourceUrl,
|
|
41
41
|
storage: context.storage,
|
|
42
42
|
appEngineLocation: functionsConfig_1.getAppEngineLocation(context.firebaseConfig),
|
|
43
43
|
});
|
|
@@ -18,7 +18,7 @@ const ENGINE_RUNTIMES = {
|
|
|
18
18
|
const ENGINE_RUNTIMES_NAMES = Object.values(ENGINE_RUNTIMES);
|
|
19
19
|
exports.RUNTIME_NOT_SET = "`runtime` field is required but was not found in firebase.json.\n" +
|
|
20
20
|
"To fix this, add the following lines to the `functions` section of your firebase.json:\n" +
|
|
21
|
-
'"runtime": "
|
|
21
|
+
'"runtime": "nodejs16"\n';
|
|
22
22
|
exports.UNSUPPORTED_NODE_VERSION_FIREBASE_JSON_MSG = clc.bold(`functions.runtime value is unsupported. ` +
|
|
23
23
|
`Valid choices are: ${clc.bold("nodejs{10|12|14|16}")}.`);
|
|
24
24
|
exports.UNSUPPORTED_NODE_VERSION_PACKAGE_JSON_MSG = clc.bold(`package.json in functions directory has an engines field which is unsupported. ` +
|
|
@@ -135,7 +135,7 @@ async function assertResolveDeveloperNodeModule(frb, name) {
|
|
|
135
135
|
async function verifyDeveloperNodeModules(frb) {
|
|
136
136
|
const modBundles = [
|
|
137
137
|
{ name: "firebase-admin", isDev: false, minVersion: "8.9.0" },
|
|
138
|
-
{ name: "firebase-functions", isDev: false, minVersion: "3.
|
|
138
|
+
{ name: "firebase-functions", isDev: false, minVersion: "3.13.1" },
|
|
139
139
|
];
|
|
140
140
|
for (const modBundle of modBundles) {
|
|
141
141
|
const resolution = await resolveDeveloperNodeModule(frb, modBundle.name);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "firebase-tools",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0",
|
|
4
4
|
"description": "Command-Line Interface for Firebase",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
],
|
|
56
56
|
"preferGlobal": true,
|
|
57
57
|
"engines": {
|
|
58
|
-
"node": ">=
|
|
58
|
+
"node": ">= 12"
|
|
59
59
|
},
|
|
60
60
|
"author": "Firebase (https://firebase.google.com/)",
|
|
61
61
|
"license": "MIT",
|