firebase-tools 11.2.0 → 11.3.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/lib/checkValidTargetFilters.js +3 -3
- package/lib/commands/ext-export.js +2 -0
- package/lib/deploy/extensions/planner.js +1 -0
- package/lib/deploy/extensions/prepare.js +18 -1
- package/lib/deploy/extensions/release.js +4 -0
- package/lib/deploy/functions/build.js +43 -52
- package/lib/deploy/functions/params.js +189 -0
- package/lib/deploy/functions/prepare.js +2 -2
- package/lib/deploy/functions/runtimes/node/parseTriggers.js +2 -2
- package/lib/deploy/lifecycleHooks.js +1 -1
- package/lib/deploy/storage/prepare.js +1 -1
- package/lib/downloadUtils.js +1 -1
- package/lib/emulator/downloadableEmulators.js +14 -14
- package/lib/emulator/functionsEmulator.js +10 -9
- package/lib/emulator/functionsEmulatorRuntime.js +70 -64
- package/lib/emulator/functionsEmulatorShared.js +7 -5
- package/lib/emulator/functionsRuntimeWorker.js +35 -15
- package/lib/emulator/storage/apis/gcloud.js +1 -1
- package/lib/extensions/etags.js +28 -0
- package/lib/extensions/warnings.js +7 -1
- package/lib/functions/env.js +5 -1
- package/lib/functionsConfig.js +1 -1
- package/lib/gcp/rules.js +2 -3
- package/lib/gcp/runtimeconfig.js +1 -1
- package/lib/hosting/api.js +9 -11
- package/lib/hosting/expireUtils.js +2 -2
- package/lib/management/projects.js +6 -7
- package/lib/profileReport.js +16 -14
- package/lib/rc.js +11 -1
- package/lib/requireConfig.js +6 -6
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/lib/profileReport.js
CHANGED
|
@@ -303,14 +303,14 @@ class ProfileReport {
|
|
|
303
303
|
});
|
|
304
304
|
});
|
|
305
305
|
const paths = Object.keys(unindexed);
|
|
306
|
-
|
|
306
|
+
for (const path of paths) {
|
|
307
307
|
const indices = Object.keys(unindexed[path]);
|
|
308
|
-
|
|
308
|
+
for (const index of indices) {
|
|
309
309
|
const data = unindexed[path][index];
|
|
310
310
|
const row = [path, extractReadableIndex(data.query), formatNumber(data.times)];
|
|
311
311
|
table.push(row);
|
|
312
|
-
}
|
|
313
|
-
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
314
|
return table;
|
|
315
315
|
}
|
|
316
316
|
renderBandwidth(pureData) {
|
|
@@ -327,8 +327,10 @@ class ProfileReport {
|
|
|
327
327
|
times: b1.times + b2.times,
|
|
328
328
|
};
|
|
329
329
|
});
|
|
330
|
-
const paths =
|
|
331
|
-
|
|
330
|
+
const paths = Object.keys(data).sort((a, b) => {
|
|
331
|
+
return data[b].bytes - data[a].bytes;
|
|
332
|
+
});
|
|
333
|
+
for (const path of paths) {
|
|
332
334
|
const bandwidth = data[path];
|
|
333
335
|
const row = [
|
|
334
336
|
path,
|
|
@@ -337,7 +339,7 @@ class ProfileReport {
|
|
|
337
339
|
formatBytes(bandwidth.bytes / bandwidth.times),
|
|
338
340
|
];
|
|
339
341
|
table.push(row);
|
|
340
|
-
}
|
|
342
|
+
}
|
|
341
343
|
return table;
|
|
342
344
|
}
|
|
343
345
|
renderOutgoingBandwidth() {
|
|
@@ -392,12 +394,12 @@ class ProfileReport {
|
|
|
392
394
|
rejected: s1.rejected + s2.rejected,
|
|
393
395
|
};
|
|
394
396
|
});
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
const
|
|
398
|
-
return
|
|
399
|
-
}
|
|
400
|
-
|
|
397
|
+
const paths = Object.keys(data).sort((a, b) => {
|
|
398
|
+
const speedA = data[a].millis / data[a].times;
|
|
399
|
+
const speedB = data[b].millis / data[b].times;
|
|
400
|
+
return speedB - speedA;
|
|
401
|
+
});
|
|
402
|
+
for (const path of paths) {
|
|
401
403
|
const speed = data[path];
|
|
402
404
|
const row = [
|
|
403
405
|
path,
|
|
@@ -409,7 +411,7 @@ class ProfileReport {
|
|
|
409
411
|
row.push(formatNumber(speed.rejected));
|
|
410
412
|
}
|
|
411
413
|
table.push(row);
|
|
412
|
-
}
|
|
414
|
+
}
|
|
413
415
|
return table;
|
|
414
416
|
}
|
|
415
417
|
renderReadSpeed() {
|
package/lib/rc.js
CHANGED
|
@@ -25,7 +25,7 @@ exports.loadRC = loadRC;
|
|
|
25
25
|
class RC {
|
|
26
26
|
constructor(rcpath, data) {
|
|
27
27
|
this.path = rcpath;
|
|
28
|
-
this.data = Object.assign({ projects: {}, targets: {} }, data);
|
|
28
|
+
this.data = Object.assign({ projects: {}, targets: {}, etags: {} }, data);
|
|
29
29
|
}
|
|
30
30
|
static loadFile(rcpath) {
|
|
31
31
|
let data = {};
|
|
@@ -148,6 +148,16 @@ class RC {
|
|
|
148
148
|
}
|
|
149
149
|
return target;
|
|
150
150
|
}
|
|
151
|
+
getEtags(projectId) {
|
|
152
|
+
return this.data.etags[projectId] || { extensionInstances: {} };
|
|
153
|
+
}
|
|
154
|
+
setEtags(projectId, resourceType, etagData) {
|
|
155
|
+
if (!this.data.etags[projectId]) {
|
|
156
|
+
this.data.etags[projectId] = {};
|
|
157
|
+
}
|
|
158
|
+
this.data.etags[projectId][resourceType] = etagData;
|
|
159
|
+
this.save();
|
|
160
|
+
}
|
|
151
161
|
save() {
|
|
152
162
|
if (this.path) {
|
|
153
163
|
fs.writeFileSync(this.path, JSON.stringify(this.data, null, 2), {
|
package/lib/requireConfig.js
CHANGED
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.requireConfig = void 0;
|
|
4
4
|
const error_1 = require("./error");
|
|
5
5
|
async function requireConfig(options) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
?
|
|
10
|
-
: new error_1.FirebaseError("Not in a Firebase project directory (could not locate firebase.json)");
|
|
11
|
-
}
|
|
6
|
+
return new Promise((resolve, reject) => {
|
|
7
|
+
var _a;
|
|
8
|
+
return options.config
|
|
9
|
+
? resolve()
|
|
10
|
+
: reject((_a = options.configError) !== null && _a !== void 0 ? _a : new error_1.FirebaseError("Not in a Firebase project directory (could not locate firebase.json)"));
|
|
11
|
+
});
|
|
12
12
|
}
|
|
13
13
|
exports.requireConfig = requireConfig;
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "firebase-tools",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.3.0",
|
|
4
4
|
"lockfileVersion": 2,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "firebase-tools",
|
|
9
|
-
"version": "11.
|
|
9
|
+
"version": "11.3.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@google-cloud/pubsub": "^3.0.1",
|