firebase-tools 10.8.0 → 10.9.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/commands/functions-list.js +12 -20
- package/lib/deploy/functions/backend.js +0 -4
- package/lib/deploy/functions/prepare.js +0 -9
- package/lib/deploy/functions/runtimes/discovery/index.js +2 -1
- package/lib/deploy/functions/runtimes/discovery/v1alpha1.js +8 -9
- package/lib/deploy/functions/runtimes/node/index.js +26 -26
- package/lib/deploy/functions/validate.js +66 -29
- package/lib/deploy/index.js +2 -1
- package/lib/emulator/controller.js +10 -5
- package/lib/emulator/downloadableEmulators.js +18 -34
- package/lib/emulator/extensionsEmulator.js +1 -1
- package/lib/emulator/functionsEmulator.js +4 -1
- package/lib/frameworks/index.js +121 -0
- package/lib/functions/functionslog.js +4 -9
- package/lib/gcp/cloudfunctionsv2.js +2 -8
- package/lib/hosting/normalizedHostingConfigs.js +3 -0
- package/lib/previews.js +1 -1
- package/lib/serve/index.js +2 -1
- package/npm-shrinkwrap.json +103 -9
- package/package.json +2 -2
- package/schema/firebase-config.json +9 -0
- package/templates/extensions/javascript/package.lint.json +5 -5
- package/templates/extensions/javascript/package.nolint.json +3 -3
- package/templates/extensions/typescript/package.lint.json +6 -6
- package/templates/init/functions/typescript/package.nolint.json +4 -5
|
@@ -5,7 +5,6 @@ const error_1 = require("../error");
|
|
|
5
5
|
const projectUtils_1 = require("../projectUtils");
|
|
6
6
|
const requirePermissions_1 = require("../requirePermissions");
|
|
7
7
|
const backend = require("../deploy/functions/backend");
|
|
8
|
-
const previews_1 = require("../previews");
|
|
9
8
|
const logger_1 = require("../logger");
|
|
10
9
|
const Table = require("cli-table");
|
|
11
10
|
exports.default = new command_1.Command("functions:list")
|
|
@@ -18,28 +17,21 @@ exports.default = new command_1.Command("functions:list")
|
|
|
18
17
|
};
|
|
19
18
|
const existing = await backend.existingBackend(context);
|
|
20
19
|
const endpointsList = backend.allEndpoints(existing).sort(backend.compareFunctions);
|
|
21
|
-
const table =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
})
|
|
26
|
-
: new Table({
|
|
27
|
-
head: ["Function", "Trigger", "Location", "Memory", "Runtime"],
|
|
28
|
-
style: { head: ["yellow"] },
|
|
29
|
-
});
|
|
20
|
+
const table = new Table({
|
|
21
|
+
head: ["Function", "Version", "Trigger", "Location", "Memory", "Runtime"],
|
|
22
|
+
style: { head: ["yellow"] },
|
|
23
|
+
});
|
|
30
24
|
for (const endpoint of endpointsList) {
|
|
31
25
|
const trigger = backend.endpointTriggerType(endpoint);
|
|
32
26
|
const availableMemoryMb = endpoint.availableMemoryMb || "---";
|
|
33
|
-
const entry =
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
]
|
|
42
|
-
: [endpoint.id, trigger, endpoint.region, availableMemoryMb, endpoint.runtime];
|
|
27
|
+
const entry = [
|
|
28
|
+
endpoint.id,
|
|
29
|
+
endpoint.platform === "gcfv2" ? "v2" : "v1",
|
|
30
|
+
trigger,
|
|
31
|
+
endpoint.region,
|
|
32
|
+
availableMemoryMb,
|
|
33
|
+
endpoint.runtime,
|
|
34
|
+
];
|
|
43
35
|
table.push(entry);
|
|
44
36
|
}
|
|
45
37
|
logger_1.logger.info(table.toString());
|
|
@@ -6,7 +6,6 @@ const gcfV2 = require("../../gcp/cloudfunctionsv2");
|
|
|
6
6
|
const run = require("../../gcp/run");
|
|
7
7
|
const utils = require("../../utils");
|
|
8
8
|
const error_1 = require("../../error");
|
|
9
|
-
const previews_1 = require("../../previews");
|
|
10
9
|
const functional_1 = require("../../functional");
|
|
11
10
|
function endpointTriggerType(endpoint) {
|
|
12
11
|
if (isScheduleTriggered(endpoint)) {
|
|
@@ -192,9 +191,6 @@ async function loadExistingBackend(ctx) {
|
|
|
192
191
|
ctx.existingBackend.endpoints[endpoint.region][endpoint.id] = endpoint;
|
|
193
192
|
}
|
|
194
193
|
ctx.unreachableRegions.gcfV1 = gcfV1Results.unreachable;
|
|
195
|
-
if (!previews_1.previews.functionsv2) {
|
|
196
|
-
return;
|
|
197
|
-
}
|
|
198
194
|
let gcfV2Results;
|
|
199
195
|
try {
|
|
200
196
|
gcfV2Results = await gcfV2.listAllFunctions(ctx.projectId);
|
|
@@ -108,15 +108,6 @@ async function prepare(context, options, payload) {
|
|
|
108
108
|
(0, utils_1.logLabeledBullet)("functions", `preparing ${clc.bold(sourceDirName)} directory for uploading...`);
|
|
109
109
|
}
|
|
110
110
|
if (backend.someEndpoint(wantBackend, (e) => e.platform === "gcfv2")) {
|
|
111
|
-
if (!previews_1.previews.functionsv2) {
|
|
112
|
-
throw new error_1.FirebaseError("This version of firebase-tools does not support Google Cloud " +
|
|
113
|
-
"Functions gen 2\n" +
|
|
114
|
-
"If Cloud Functions for Firebase gen 2 is still in alpha, sign up " +
|
|
115
|
-
"for the alpha program at " +
|
|
116
|
-
"https://services.google.com/fb/forms/firebasealphaprogram/\n" +
|
|
117
|
-
"If Cloud Functions for Firebase gen 2 is in beta, get the latest " +
|
|
118
|
-
"version of Firebse Tools with `npm i -g firebase-tools@latest`");
|
|
119
|
-
}
|
|
120
111
|
source.functionsSourceV2 = await (0, prepareFunctionsUpload_1.prepareFunctionsUpload)(sourceDir, config);
|
|
121
112
|
}
|
|
122
113
|
if (backend.someEndpoint(wantBackend, (e) => e.platform === "gcfv1")) {
|
|
@@ -71,7 +71,8 @@ async function detectFromPort(port, project, runtime, timeout = 30000) {
|
|
|
71
71
|
parsed = yaml.load(text);
|
|
72
72
|
}
|
|
73
73
|
catch (err) {
|
|
74
|
-
|
|
74
|
+
logger_1.logger.debug("Failed to parse functions.yaml", err);
|
|
75
|
+
throw new error_1.FirebaseError(`Failed to load function definition from source: ${text}`);
|
|
75
76
|
}
|
|
76
77
|
return yamlToBackend(parsed, project, api.functionsDefaultRegion, runtime);
|
|
77
78
|
}
|
|
@@ -189,16 +189,15 @@ function parseEndpoints(manifest, id, project, defaultRegion, runtime) {
|
|
|
189
189
|
runtime, entryPoint: ep.entryPoint }, triggered);
|
|
190
190
|
(0, proto_1.copyIfPresent)(parsed, ep, "availableMemoryMb", "maxInstances", "minInstances", "concurrency", "serviceAccountEmail", "timeoutSeconds", "vpc", "labels", "ingressSettings", "environmentVariables", "cpu");
|
|
191
191
|
(0, proto_1.renameIfPresent)(parsed, ep, "secretEnvironmentVariables", "secretEnvironmentVariables", (senvs) => {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
});
|
|
200
|
-
}
|
|
192
|
+
const secretEnvironmentVariables = [];
|
|
193
|
+
for (const { key, secret } of senvs) {
|
|
194
|
+
secretEnvironmentVariables.push({
|
|
195
|
+
key,
|
|
196
|
+
secret: secret || key,
|
|
197
|
+
projectId: project,
|
|
198
|
+
});
|
|
201
199
|
}
|
|
200
|
+
return secretEnvironmentVariables;
|
|
202
201
|
});
|
|
203
202
|
allParsed.push(parsed);
|
|
204
203
|
}
|
|
@@ -11,7 +11,6 @@ const node_fetch_1 = require("node-fetch");
|
|
|
11
11
|
const error_1 = require("../../../../error");
|
|
12
12
|
const parseRuntimeAndValidateSDK_1 = require("./parseRuntimeAndValidateSDK");
|
|
13
13
|
const logger_1 = require("../../../../logger");
|
|
14
|
-
const previews_1 = require("../../../../previews");
|
|
15
14
|
const utils_1 = require("../../../../utils");
|
|
16
15
|
const discovery = require("../discovery");
|
|
17
16
|
const validate = require("./validate");
|
|
@@ -58,10 +57,14 @@ class Delegate {
|
|
|
58
57
|
watch() {
|
|
59
58
|
return Promise.resolve(() => Promise.resolve());
|
|
60
59
|
}
|
|
61
|
-
serve(port, envs) {
|
|
60
|
+
serve(port, config, envs) {
|
|
62
61
|
var _a;
|
|
62
|
+
const env = Object.assign(Object.assign({}, envs), { PORT: port.toString(), FUNCTIONS_CONTROL_API: "true", HOME: process.env.HOME, PATH: process.env.PATH });
|
|
63
|
+
if (Object.keys(config || {}).length) {
|
|
64
|
+
env.CLOUD_RUNTIME_CONFIG = JSON.stringify(config);
|
|
65
|
+
}
|
|
63
66
|
const childProcess = spawn("./node_modules/.bin/firebase-functions", [this.sourceDir], {
|
|
64
|
-
env
|
|
67
|
+
env,
|
|
65
68
|
cwd: this.sourceDir,
|
|
66
69
|
stdio: ["ignore", "pipe", "inherit"],
|
|
67
70
|
});
|
|
@@ -83,32 +86,29 @@ class Delegate {
|
|
|
83
86
|
});
|
|
84
87
|
}
|
|
85
88
|
async discoverSpec(config, env) {
|
|
86
|
-
if (
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
89
|
+
if (!semver.valid(this.sdkVersion)) {
|
|
90
|
+
logger_1.logger.debug(`Could not parse firebase-functions version '${this.sdkVersion}' into semver. Falling back to parseTriggers.`);
|
|
91
|
+
return parseTriggers.discoverBackend(this.projectId, this.sourceDir, this.runtime, config, env);
|
|
92
|
+
}
|
|
93
|
+
if (semver.lt(this.sdkVersion, MIN_FUNCTIONS_SDK_VERSION)) {
|
|
94
|
+
(0, utils_1.logLabeledWarning)("functions", `You are using an old version of firebase-functions SDK (${this.sdkVersion}). ` +
|
|
95
|
+
`Please update firebase-functions SDK to >=${MIN_FUNCTIONS_SDK_VERSION}`);
|
|
96
|
+
return parseTriggers.discoverBackend(this.projectId, this.sourceDir, this.runtime, config, env);
|
|
97
|
+
}
|
|
98
|
+
let discovered = await discovery.detectFromYaml(this.sourceDir, this.projectId, this.runtime);
|
|
99
|
+
if (!discovered) {
|
|
100
|
+
const getPort = (0, util_1.promisify)(portfinder.getPort);
|
|
101
|
+
const port = await getPort();
|
|
102
|
+
const kill = await this.serve(port, config, env);
|
|
103
|
+
try {
|
|
104
|
+
discovered = await discovery.detectFromPort(port, this.projectId, this.runtime);
|
|
95
105
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
const getPort = (0, util_1.promisify)(portfinder.getPort);
|
|
99
|
-
const port = await getPort();
|
|
100
|
-
const kill = await this.serve(port, env);
|
|
101
|
-
try {
|
|
102
|
-
discovered = await discovery.detectFromPort(port, this.projectId, this.runtime);
|
|
103
|
-
}
|
|
104
|
-
finally {
|
|
105
|
-
await kill();
|
|
106
|
-
}
|
|
106
|
+
finally {
|
|
107
|
+
await kill();
|
|
107
108
|
}
|
|
108
|
-
discovered.environmentVariables = env;
|
|
109
|
-
return discovered;
|
|
110
109
|
}
|
|
111
|
-
|
|
110
|
+
discovered.environmentVariables = env;
|
|
111
|
+
return discovered;
|
|
112
112
|
}
|
|
113
113
|
async discoverBuild(config, env) {
|
|
114
114
|
return parseTriggers.discoverBuild(this.projectId, this.sourceDir, this.runtime, config, env);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.secretsAreValid = exports.functionIdsAreValid = exports.functionsDirectoryExists = exports.endpointsAreUnique = exports.endpointsAreValid = void 0;
|
|
3
|
+
exports.secretsAreValid = exports.functionIdsAreValid = exports.functionsDirectoryExists = exports.endpointsAreUnique = exports.cpuConfigIsValid = exports.endpointsAreValid = void 0;
|
|
4
4
|
const path = require("path");
|
|
5
5
|
const clc = require("cli-color");
|
|
6
6
|
const error_1 = require("../../error");
|
|
@@ -11,61 +11,98 @@ const backend = require("./backend");
|
|
|
11
11
|
const utils = require("../../utils");
|
|
12
12
|
const secrets = require("../../functions/secrets");
|
|
13
13
|
const services_1 = require("./services");
|
|
14
|
+
function matchingIds(endpoints, filter) {
|
|
15
|
+
return endpoints
|
|
16
|
+
.filter(filter)
|
|
17
|
+
.map((endpoint) => endpoint.id)
|
|
18
|
+
.join(",");
|
|
19
|
+
}
|
|
20
|
+
const mem = (endpoint) => endpoint.availableMemoryMb || backend.DEFAULT_MEMORY;
|
|
21
|
+
const cpu = (endpoint) => {
|
|
22
|
+
var _a;
|
|
23
|
+
return endpoint.cpu === "gcf_gen1"
|
|
24
|
+
? backend.memoryToGen1Cpu(mem(endpoint))
|
|
25
|
+
: (_a = endpoint.cpu) !== null && _a !== void 0 ? _a : backend.memoryToGen2Cpu(mem(endpoint));
|
|
26
|
+
};
|
|
14
27
|
function endpointsAreValid(wantBackend) {
|
|
15
28
|
const endpoints = backend.allEndpoints(wantBackend);
|
|
16
29
|
functionIdsAreValid(endpoints);
|
|
17
30
|
for (const ep of endpoints) {
|
|
18
31
|
(0, services_1.serviceForEndpoint)(ep).validateTrigger(ep, wantBackend);
|
|
19
32
|
}
|
|
20
|
-
const gcfV1WithConcurrency = endpoints
|
|
21
|
-
.filter((endpoint) => (endpoint.concurrency || 1) !== 1 && endpoint.platform === "gcfv1")
|
|
22
|
-
.map((endpoint) => endpoint.id);
|
|
33
|
+
const gcfV1WithConcurrency = matchingIds(endpoints, (endpoint) => (endpoint.concurrency || 1) !== 1 && endpoint.platform === "gcfv1");
|
|
23
34
|
if (gcfV1WithConcurrency.length) {
|
|
24
|
-
const msg = `Cannot set concurrency on the functions ${gcfV1WithConcurrency
|
|
35
|
+
const msg = `Cannot set concurrency on the functions ${gcfV1WithConcurrency} because they are GCF gen 1`;
|
|
25
36
|
throw new error_1.FirebaseError(msg);
|
|
26
37
|
}
|
|
27
|
-
const tooSmallForConcurrency = endpoints
|
|
28
|
-
.filter((endpoint) => {
|
|
38
|
+
const tooSmallForConcurrency = matchingIds(endpoints, (endpoint) => {
|
|
29
39
|
if ((endpoint.concurrency || 1) === 1) {
|
|
30
40
|
return false;
|
|
31
41
|
}
|
|
32
|
-
return endpoint
|
|
33
|
-
})
|
|
34
|
-
.map((endpoint) => endpoint.id);
|
|
42
|
+
return cpu(endpoint) < backend.MIN_CPU_FOR_CONCURRENCY;
|
|
43
|
+
});
|
|
35
44
|
if (tooSmallForConcurrency.length) {
|
|
36
45
|
const msg = "The following functions are configured to allow concurrent " +
|
|
37
46
|
"execution and less than one full CPU. This is not supported: " +
|
|
38
|
-
tooSmallForConcurrency
|
|
47
|
+
tooSmallForConcurrency;
|
|
39
48
|
throw new error_1.FirebaseError(msg);
|
|
40
49
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
50
|
+
cpuConfigIsValid(endpoints);
|
|
51
|
+
}
|
|
52
|
+
exports.endpointsAreValid = endpointsAreValid;
|
|
53
|
+
function cpuConfigIsValid(endpoints) {
|
|
54
|
+
const gcfV1WithCPU = matchingIds(endpoints, (endpoint) => endpoint.platform === "gcfv1" && typeof endpoint["cpu"] !== "undefined");
|
|
44
55
|
if (gcfV1WithCPU.length) {
|
|
45
|
-
const msg = `Cannot set CPU on the functions ${gcfV1WithCPU
|
|
56
|
+
const msg = `Cannot set CPU on the functions ${gcfV1WithCPU} because they are GCF gen 1`;
|
|
46
57
|
throw new error_1.FirebaseError(msg);
|
|
47
58
|
}
|
|
48
|
-
const invalidCPU = endpoints
|
|
49
|
-
|
|
50
|
-
if (
|
|
51
|
-
return
|
|
59
|
+
const invalidCPU = matchingIds(endpoints, (endpoint) => {
|
|
60
|
+
const c = cpu(endpoint);
|
|
61
|
+
if (c < 0.08) {
|
|
62
|
+
return true;
|
|
52
63
|
}
|
|
53
|
-
if (
|
|
64
|
+
if (c < 1) {
|
|
54
65
|
return false;
|
|
55
66
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
return ![1, 2, 4, 6, 8].includes(cpu);
|
|
61
|
-
})
|
|
62
|
-
.map((endpoint) => endpoint.id);
|
|
67
|
+
return ![1, 2, 4, 6, 8].includes(c);
|
|
68
|
+
});
|
|
63
69
|
if (invalidCPU.length) {
|
|
64
|
-
const msg = `The following functions have invalid CPU settings ${invalidCPU
|
|
70
|
+
const msg = `The following functions have invalid CPU settings ${invalidCPU}. Valid CPU options are (0.08, 1], 2, 4, 6, 8, or "gcf_gen1"`;
|
|
71
|
+
throw new error_1.FirebaseError(msg);
|
|
72
|
+
}
|
|
73
|
+
const smallCPURegions = ["australia-southeast2", "asia-northeast3", "asia-south2"];
|
|
74
|
+
const tooBigCPUForRegion = matchingIds(endpoints, (endpoint) => smallCPURegions.includes(endpoint.region) && cpu(endpoint) > 4);
|
|
75
|
+
if (tooBigCPUForRegion) {
|
|
76
|
+
const msg = `The functions ${tooBigCPUForRegion} have > 4 CPU in a region that supports a maximum 4 CPU`;
|
|
77
|
+
throw new error_1.FirebaseError(msg);
|
|
78
|
+
}
|
|
79
|
+
const tooSmallCPUSmall = matchingIds(endpoints, (endpoint) => mem(endpoint) > 512 && cpu(endpoint) < 0.5);
|
|
80
|
+
if (tooSmallCPUSmall) {
|
|
81
|
+
const msg = `The functions ${tooSmallCPUSmall} have too little CPU for their memory allocation. A minimum of 0.5 CPU is needed to set a memory limit greater than 512MiB`;
|
|
82
|
+
throw new error_1.FirebaseError(msg);
|
|
83
|
+
}
|
|
84
|
+
const tooSmallCPUBig = matchingIds(endpoints, (endpoint) => mem(endpoint) > 1024 && cpu(endpoint) < 1);
|
|
85
|
+
if (tooSmallCPUBig) {
|
|
86
|
+
const msg = `The functions ${tooSmallCPUSmall} have too little CPU for their memory allocation. A minimum of 1 CPU is needed to set a memory limit greater than 1GiB`;
|
|
87
|
+
throw new error_1.FirebaseError(msg);
|
|
88
|
+
}
|
|
89
|
+
const tooSmallMemory4CPU = matchingIds(endpoints, (endpoint) => cpu(endpoint) === 4 && mem(endpoint) < 2 << 10);
|
|
90
|
+
if (tooSmallMemory4CPU) {
|
|
91
|
+
const msg = `The functions ${tooSmallMemory4CPU} have too little memory for their CPU. Functions with 4 CPU require at least 2GiB`;
|
|
92
|
+
throw new error_1.FirebaseError(msg);
|
|
93
|
+
}
|
|
94
|
+
const tooSmallMemory6CPU = matchingIds(endpoints, (endpoint) => cpu(endpoint) === 6 && mem(endpoint) < 3 << 10);
|
|
95
|
+
if (tooSmallMemory6CPU) {
|
|
96
|
+
const msg = `The functions ${tooSmallMemory6CPU} have too little memory for their CPU. Functions with 6 CPU require at least 3GiB`;
|
|
97
|
+
throw new error_1.FirebaseError(msg);
|
|
98
|
+
}
|
|
99
|
+
const tooSmallMemory8CPU = matchingIds(endpoints, (endpoint) => cpu(endpoint) === 8 && mem(endpoint) < 4 << 10);
|
|
100
|
+
if (tooSmallMemory8CPU) {
|
|
101
|
+
const msg = `The functions ${tooSmallMemory8CPU} have too little memory for their CPU. Functions with 8 CPU require at least 4GiB`;
|
|
65
102
|
throw new error_1.FirebaseError(msg);
|
|
66
103
|
}
|
|
67
104
|
}
|
|
68
|
-
exports.
|
|
105
|
+
exports.cpuConfigIsValid = cpuConfigIsValid;
|
|
69
106
|
function endpointsAreUnique(backends) {
|
|
70
107
|
const endpointToCodebases = {};
|
|
71
108
|
for (const [codebase, b] of Object.entries(backends)) {
|
package/lib/deploy/index.js
CHANGED
|
@@ -18,6 +18,7 @@ const FunctionsTarget = require("./functions");
|
|
|
18
18
|
const StorageTarget = require("./storage");
|
|
19
19
|
const RemoteConfigTarget = require("./remoteconfig");
|
|
20
20
|
const ExtensionsTarget = require("./extensions");
|
|
21
|
+
const frameworks_1 = require("../frameworks");
|
|
21
22
|
const TARGETS = {
|
|
22
23
|
hosting: HostingTarget,
|
|
23
24
|
database: DatabaseTarget,
|
|
@@ -45,7 +46,7 @@ const deploy = async function (targetNames, options, customContext = {}) {
|
|
|
45
46
|
if (previews_1.previews.frameworkawareness && targetNames.includes("hosting")) {
|
|
46
47
|
const config = options.config.get("hosting");
|
|
47
48
|
if (Array.isArray(config) ? config.some((it) => it.source) : config.source) {
|
|
48
|
-
await
|
|
49
|
+
await (0, frameworks_1.prepareFrameworks)(targetNames, context, options);
|
|
49
50
|
}
|
|
50
51
|
}
|
|
51
52
|
for (const targetName of targetNames) {
|
|
@@ -37,9 +37,10 @@ const config_1 = require("./storage/rules/config");
|
|
|
37
37
|
const getDefaultDatabaseInstance_1 = require("../getDefaultDatabaseInstance");
|
|
38
38
|
const auth_2 = require("../auth");
|
|
39
39
|
const extensionsEmulator_1 = require("./extensionsEmulator");
|
|
40
|
-
const previews_1 = require("../previews");
|
|
41
40
|
const projectConfig_1 = require("../functions/projectConfig");
|
|
42
41
|
const downloadableEmulators_1 = require("./downloadableEmulators");
|
|
42
|
+
const frameworks_1 = require("../frameworks");
|
|
43
|
+
const previews_1 = require("../previews");
|
|
43
44
|
const START_LOGGING_EMULATOR = utils.envOverride("START_LOGGING_EMULATOR", "false", (val) => val === "true");
|
|
44
45
|
async function getAndCheckAddress(emulator, options) {
|
|
45
46
|
var _a, _b, _c, _d;
|
|
@@ -125,9 +126,7 @@ async function cleanShutdown() {
|
|
|
125
126
|
exports.cleanShutdown = cleanShutdown;
|
|
126
127
|
function filterEmulatorTargets(options) {
|
|
127
128
|
let targets = [...types_1.ALL_SERVICE_EMULATORS];
|
|
128
|
-
|
|
129
|
-
targets.push(types_1.Emulators.EXTENSIONS);
|
|
130
|
-
}
|
|
129
|
+
targets.push(types_1.Emulators.EXTENSIONS);
|
|
131
130
|
targets = targets.filter((e) => {
|
|
132
131
|
return options.config.has(e) || options.config.has(`emulators.${e}`);
|
|
133
132
|
});
|
|
@@ -245,6 +244,12 @@ async function startAll(options, showUI = true) {
|
|
|
245
244
|
}
|
|
246
245
|
}
|
|
247
246
|
}
|
|
247
|
+
if (previews_1.previews.frameworkawareness) {
|
|
248
|
+
const config = options.config.get("hosting");
|
|
249
|
+
if (Array.isArray(config) ? config.some((it) => it.source) : config.source) {
|
|
250
|
+
await (0, frameworks_1.prepareFrameworks)(targets, options, options);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
248
253
|
if (shouldStart(options, types_1.Emulators.HUB)) {
|
|
249
254
|
const hubAddr = await getAndCheckAddress(types_1.Emulators.HUB, options);
|
|
250
255
|
const hub = new hub_1.EmulatorHub(Object.assign({ projectId }, hubAddr));
|
|
@@ -282,7 +287,7 @@ async function startAll(options, showUI = true) {
|
|
|
282
287
|
});
|
|
283
288
|
}
|
|
284
289
|
}
|
|
285
|
-
if (shouldStart(options, types_1.Emulators.EXTENSIONS)
|
|
290
|
+
if (shouldStart(options, types_1.Emulators.EXTENSIONS)) {
|
|
286
291
|
const projectNumber = constants_1.Constants.isDemoProject(projectId)
|
|
287
292
|
? constants_1.Constants.FAKE_PROJECT_NUMBER
|
|
288
293
|
: await (0, projectUtils_1.needProjectNumber)(options);
|
|
@@ -50,15 +50,15 @@ exports.DownloadDetails = {
|
|
|
50
50
|
namePrefix: "cloud-storage-rules-emulator",
|
|
51
51
|
},
|
|
52
52
|
},
|
|
53
|
-
ui: previews_1.previews.
|
|
53
|
+
ui: previews_1.previews.emulatoruisnapshot
|
|
54
54
|
? {
|
|
55
|
-
version: "
|
|
56
|
-
downloadPath: path.join(CACHE_DIR, "ui-
|
|
57
|
-
unzipDir: path.join(CACHE_DIR, "ui-
|
|
58
|
-
binaryPath: path.join(CACHE_DIR, "ui-
|
|
55
|
+
version: "SNAPSHOT",
|
|
56
|
+
downloadPath: path.join(CACHE_DIR, "ui-vSNAPSHOT.zip"),
|
|
57
|
+
unzipDir: path.join(CACHE_DIR, "ui-vSNAPSHOT"),
|
|
58
|
+
binaryPath: path.join(CACHE_DIR, "ui-vSNAPSHOT", "server.bundle.js"),
|
|
59
59
|
opts: {
|
|
60
60
|
cacheDir: CACHE_DIR,
|
|
61
|
-
remoteUrl: "https://storage.googleapis.com/firebase-preview-drop/emulator/ui-
|
|
61
|
+
remoteUrl: "https://storage.googleapis.com/firebase-preview-drop/emulator/ui-vSNAPSHOT.zip",
|
|
62
62
|
expectedSize: -1,
|
|
63
63
|
expectedChecksum: "",
|
|
64
64
|
skipCache: true,
|
|
@@ -66,35 +66,19 @@ exports.DownloadDetails = {
|
|
|
66
66
|
namePrefix: "ui",
|
|
67
67
|
},
|
|
68
68
|
}
|
|
69
|
-
:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
skipCache: true,
|
|
81
|
-
skipChecksumAndSize: true,
|
|
82
|
-
namePrefix: "ui",
|
|
83
|
-
},
|
|
84
|
-
}
|
|
85
|
-
: {
|
|
86
|
-
version: "1.6.6",
|
|
87
|
-
downloadPath: path.join(CACHE_DIR, "ui-v1.6.6.zip"),
|
|
88
|
-
unzipDir: path.join(CACHE_DIR, "ui-v1.6.6"),
|
|
89
|
-
binaryPath: path.join(CACHE_DIR, "ui-v1.6.6", "server.bundle.js"),
|
|
90
|
-
opts: {
|
|
91
|
-
cacheDir: CACHE_DIR,
|
|
92
|
-
remoteUrl: "https://storage.googleapis.com/firebase-preview-drop/emulator/ui-v1.6.6.zip",
|
|
93
|
-
expectedSize: 3817247,
|
|
94
|
-
expectedChecksum: "c80a3f0ae1e3f682ace0a18a9cdd2861",
|
|
95
|
-
namePrefix: "ui",
|
|
96
|
-
},
|
|
69
|
+
: {
|
|
70
|
+
version: "1.7.0",
|
|
71
|
+
downloadPath: path.join(CACHE_DIR, "ui-v1.7.0.zip"),
|
|
72
|
+
unzipDir: path.join(CACHE_DIR, "ui-v1.7.0"),
|
|
73
|
+
binaryPath: path.join(CACHE_DIR, "ui-v1.7.0", "server.bundle.js"),
|
|
74
|
+
opts: {
|
|
75
|
+
cacheDir: CACHE_DIR,
|
|
76
|
+
remoteUrl: "https://storage.googleapis.com/firebase-preview-drop/emulator/ui-v1.7.0.zip",
|
|
77
|
+
expectedSize: 4053708,
|
|
78
|
+
expectedChecksum: "aea9ae19091df5974a88a8847aaf127c",
|
|
79
|
+
namePrefix: "ui",
|
|
97
80
|
},
|
|
81
|
+
},
|
|
98
82
|
pubsub: {
|
|
99
83
|
downloadPath: path.join(CACHE_DIR, "pubsub-emulator-0.1.0.zip"),
|
|
100
84
|
version: "0.1.0",
|
|
@@ -65,7 +65,7 @@ class ExtensionsEmulator {
|
|
|
65
65
|
if (!this.hasValidSource({ path: instance.localPath, extTarget: instance.localPath })) {
|
|
66
66
|
throw new error_1.FirebaseError(`Tried to emulate local extension at ${instance.localPath}, but it was missing required files.`);
|
|
67
67
|
}
|
|
68
|
-
return instance.localPath;
|
|
68
|
+
return path.resolve(instance.localPath);
|
|
69
69
|
}
|
|
70
70
|
else if (instance.ref) {
|
|
71
71
|
const ref = (0, refs_1.toExtensionVersionRef)(instance.ref);
|
|
@@ -667,7 +667,10 @@ class FunctionsEmulator {
|
|
|
667
667
|
envs.FUNCTIONS_EMULATOR = "true";
|
|
668
668
|
envs.TZ = "UTC";
|
|
669
669
|
envs.FIREBASE_DEBUG_MODE = "true";
|
|
670
|
-
envs.FIREBASE_DEBUG_FEATURES = JSON.stringify({
|
|
670
|
+
envs.FIREBASE_DEBUG_FEATURES = JSON.stringify({
|
|
671
|
+
skipTokenVerification: true,
|
|
672
|
+
enableCors: true,
|
|
673
|
+
});
|
|
671
674
|
const firestoreEmulator = this.getEmulatorInfo(types_1.Emulators.FIRESTORE);
|
|
672
675
|
if (firestoreEmulator != null) {
|
|
673
676
|
envs[constants_1.Constants.FIRESTORE_EMULATOR_HOST] = (0, functionsEmulatorShared_1.formatHost)(firestoreEmulator);
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.prepareFrameworks = exports.shortSiteName = void 0;
|
|
4
|
+
const path_1 = require("path");
|
|
5
|
+
const process_1 = require("process");
|
|
6
|
+
const projectUtils_1 = require("../projectUtils");
|
|
7
|
+
const normalizedHostingConfigs_1 = require("../hosting/normalizedHostingConfigs");
|
|
8
|
+
const api_1 = require("../hosting/api");
|
|
9
|
+
const apps_1 = require("../management/apps");
|
|
10
|
+
const fs_1 = require("fs");
|
|
11
|
+
const prompt_1 = require("../prompt");
|
|
12
|
+
const { writeFile } = fs_1.promises;
|
|
13
|
+
const shortSiteName = (site) => (site === null || site === void 0 ? void 0 : site.name) && site.name.split("/").pop();
|
|
14
|
+
exports.shortSiteName = shortSiteName;
|
|
15
|
+
const prepareFrameworks = async (targetNames, context, options) => {
|
|
16
|
+
const project = (0, projectUtils_1.needProjectId)(context);
|
|
17
|
+
const configs = (0, normalizedHostingConfigs_1.normalizedHostingConfigs)(Object.assign({ site: project }, options), { resolveTargets: true });
|
|
18
|
+
options.normalizedHostingConfigs = configs;
|
|
19
|
+
if (configs.length === 0)
|
|
20
|
+
return;
|
|
21
|
+
for (const config of configs) {
|
|
22
|
+
const { source, site, public: publicDir } = config;
|
|
23
|
+
if (!source)
|
|
24
|
+
continue;
|
|
25
|
+
const dist = (0, path_1.join)(".firebase", site);
|
|
26
|
+
const hostingDist = (0, path_1.join)(dist, "hosting");
|
|
27
|
+
const functionsDist = (0, path_1.join)(dist, "functions");
|
|
28
|
+
if (publicDir)
|
|
29
|
+
throw new Error(`hosting.public and hosting.source cannot both be set in firebase.json`);
|
|
30
|
+
const getProjectPath = (...args) => (0, path_1.join)(process.cwd(), source, ...args);
|
|
31
|
+
const functionName = `ssr${site.replace(/-/g, "")}`;
|
|
32
|
+
const { build } = require("firebase-frameworks/tools");
|
|
33
|
+
const { usingCloudFunctions, rewrites, redirects, headers, usesFirebaseConfig } = await build({
|
|
34
|
+
dist,
|
|
35
|
+
project,
|
|
36
|
+
site,
|
|
37
|
+
function: {
|
|
38
|
+
name: functionName,
|
|
39
|
+
region: "us-central1",
|
|
40
|
+
},
|
|
41
|
+
}, getProjectPath);
|
|
42
|
+
config.public = hostingDist;
|
|
43
|
+
if (usingCloudFunctions) {
|
|
44
|
+
if (context.hostingChannel) {
|
|
45
|
+
const message = "Cannot preview changes to the backend, you will only see changes to the static content on this channel.";
|
|
46
|
+
if (!options.nonInteractive) {
|
|
47
|
+
const continueDeploy = await (0, prompt_1.promptOnce)({
|
|
48
|
+
type: "confirm",
|
|
49
|
+
default: true,
|
|
50
|
+
message: `${message} Would you like to continue with the deploy?`,
|
|
51
|
+
});
|
|
52
|
+
if (!continueDeploy)
|
|
53
|
+
(0, process_1.exit)(1);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
console.error(message);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
const functionConfig = {
|
|
61
|
+
source: functionsDist,
|
|
62
|
+
codebase: `firebase-frameworks-${site}`,
|
|
63
|
+
};
|
|
64
|
+
if (targetNames.includes("functions")) {
|
|
65
|
+
const combinedFunctionsConfig = [functionConfig].concat(options.config.get("functions") || []);
|
|
66
|
+
options.config.set("functions", combinedFunctionsConfig);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
targetNames.unshift("functions");
|
|
70
|
+
options.config.set("functions", functionConfig);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
config.rewrites = [
|
|
74
|
+
...(config.rewrites || []),
|
|
75
|
+
...rewrites,
|
|
76
|
+
{
|
|
77
|
+
source: "**",
|
|
78
|
+
function: functionName,
|
|
79
|
+
},
|
|
80
|
+
];
|
|
81
|
+
let firebaseProjectConfig = null;
|
|
82
|
+
if (usesFirebaseConfig) {
|
|
83
|
+
const sites = await (0, api_1.listSites)(project);
|
|
84
|
+
const selectedSite = sites.find((it) => (0, exports.shortSiteName)(it) === site);
|
|
85
|
+
if (selectedSite) {
|
|
86
|
+
const { appId } = selectedSite;
|
|
87
|
+
if (appId) {
|
|
88
|
+
firebaseProjectConfig = await (0, apps_1.getAppConfig)(appId, apps_1.AppPlatform.WEB);
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
console.warn(`No Firebase app associated with site ${site}, unable to provide authenticated server context.
|
|
92
|
+
You can link a Web app to a Hosting site here https://console.firebase.google.com/project/_/settings/general/web`);
|
|
93
|
+
if (!options.nonInteractive) {
|
|
94
|
+
const continueDeploy = await (0, prompt_1.promptOnce)({
|
|
95
|
+
type: "confirm",
|
|
96
|
+
default: true,
|
|
97
|
+
message: "Would you like to continue with the deploy?",
|
|
98
|
+
});
|
|
99
|
+
if (!continueDeploy)
|
|
100
|
+
(0, process_1.exit)(1);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
writeFile((0, path_1.join)(functionsDist, ".env"), `FRAMEWORKS_FIREBASE_PROJECT_CONFIG="${JSON.stringify(firebaseProjectConfig).replace(/"/g, '\\"')}"`);
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
config.rewrites = [
|
|
109
|
+
...(config.rewrites || []),
|
|
110
|
+
...rewrites,
|
|
111
|
+
{
|
|
112
|
+
source: "**",
|
|
113
|
+
destination: "/index.html",
|
|
114
|
+
},
|
|
115
|
+
];
|
|
116
|
+
}
|
|
117
|
+
config.redirects = [...(config.redirects || []), ...redirects];
|
|
118
|
+
config.headers = [...(config.headers || []), ...headers];
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
exports.prepareFrameworks = prepareFrameworks;
|
|
@@ -2,18 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.logEntries = exports.getApiFilter = void 0;
|
|
4
4
|
const logger_1 = require("../logger");
|
|
5
|
-
const previews_1 = require("../previews");
|
|
6
5
|
function getApiFilter(functionList) {
|
|
7
|
-
const baseFilter =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
'labels."goog-managed-by"="cloudfunctions")'
|
|
11
|
-
: 'resource.type="cloud_function"';
|
|
6
|
+
const baseFilter = 'resource.type="cloud_function" OR ' +
|
|
7
|
+
'(resource.type="cloud_run_revision" AND ' +
|
|
8
|
+
'labels."goog-managed-by"="cloudfunctions")';
|
|
12
9
|
if (functionList) {
|
|
13
10
|
const apiFuncFilters = functionList.split(",").map((fn) => {
|
|
14
|
-
return
|
|
15
|
-
? `resource.labels.function_name="${fn}" ` + `OR resource.labels.service_name="${fn}"`
|
|
16
|
-
: `resource.labels.function_name="${fn}"`;
|
|
11
|
+
return `resource.labels.function_name="${fn}" ` + `OR resource.labels.service_name="${fn}"`;
|
|
17
12
|
});
|
|
18
13
|
return baseFilter + `\n(${apiFuncFilters.join(" OR ")})`;
|
|
19
14
|
}
|
|
@@ -183,14 +183,8 @@ function functionFromEndpoint(endpoint, source) {
|
|
|
183
183
|
};
|
|
184
184
|
proto.copyIfPresent(gcfFunction, endpoint, "labels");
|
|
185
185
|
proto.copyIfPresent(gcfFunction.serviceConfig, endpoint, "environmentVariables", "secretEnvironmentVariables", "serviceAccountEmail", "ingressSettings", "timeoutSeconds");
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
return `${mb / 1024}Gi`;
|
|
189
|
-
}
|
|
190
|
-
else {
|
|
191
|
-
return `${mb}Mi`;
|
|
192
|
-
}
|
|
193
|
-
});
|
|
186
|
+
const mem = endpoint.availableMemoryMb || backend.DEFAULT_MEMORY;
|
|
187
|
+
gcfFunction.serviceConfig.availableMemory = mem > 1024 ? `${mem / 1024}Gi` : `${mem}Mi`;
|
|
194
188
|
proto.renameIfPresent(gcfFunction.serviceConfig, endpoint, "minInstanceCount", "minInstances");
|
|
195
189
|
proto.renameIfPresent(gcfFunction.serviceConfig, endpoint, "maxInstanceCount", "maxInstances");
|
|
196
190
|
if (endpoint.vpc) {
|
|
@@ -57,6 +57,9 @@ function filterExcept(configs, exceptOption) {
|
|
|
57
57
|
return filteredConfigs;
|
|
58
58
|
}
|
|
59
59
|
function normalizedHostingConfigs(cmdOptions, options = {}) {
|
|
60
|
+
const normalizedHostingConfigs = cmdOptions.normalizedHostingConfigs;
|
|
61
|
+
if (normalizedHostingConfigs)
|
|
62
|
+
return normalizedHostingConfigs;
|
|
60
63
|
let configs = (0, lodash_1.cloneDeep)(cmdOptions.config.get("hosting"));
|
|
61
64
|
if (!configs) {
|
|
62
65
|
return [];
|
package/lib/previews.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.previews = void 0;
|
|
4
4
|
const lodash_1 = require("lodash");
|
|
5
5
|
const configstore_1 = require("./configstore");
|
|
6
|
-
exports.previews = Object.assign({ rtdbrules: false, ext: false, extdev: false,
|
|
6
|
+
exports.previews = Object.assign({ rtdbrules: false, ext: false, extdev: false, rtdbmanagement: false, golang: false, deletegcfartifacts: false, artifactregistry: false, emulatoruisnapshot: false, frameworkawareness: false, functionsparams: false }, configstore_1.configstore.get("previews"));
|
|
7
7
|
if (process.env.FIREBASE_CLI_PREVIEWS) {
|
|
8
8
|
process.env.FIREBASE_CLI_PREVIEWS.split(",").forEach((feature) => {
|
|
9
9
|
if ((0, lodash_1.has)(exports.previews, feature)) {
|
package/lib/serve/index.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.serve = void 0;
|
|
4
4
|
const _ = require("lodash");
|
|
5
5
|
const logger_1 = require("../logger");
|
|
6
|
+
const frameworks_1 = require("../frameworks");
|
|
6
7
|
const previews_1 = require("../previews");
|
|
7
8
|
const { FunctionsServer } = require("./functions");
|
|
8
9
|
const TARGETS = {
|
|
@@ -15,7 +16,7 @@ async function serve(options) {
|
|
|
15
16
|
if (previews_1.previews.frameworkawareness &&
|
|
16
17
|
targetNames.includes("hosting") &&
|
|
17
18
|
[].concat(options.config.get("hosting")).some((it) => it.source)) {
|
|
18
|
-
await
|
|
19
|
+
await (0, frameworks_1.prepareFrameworks)(targetNames, options, options);
|
|
19
20
|
}
|
|
20
21
|
await Promise.all(_.map(targetNames, (targetName) => {
|
|
21
22
|
return TARGETS[targetName].start(options);
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "firebase-tools",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.9.2",
|
|
4
4
|
"lockfileVersion": 2,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "firebase-tools",
|
|
9
|
-
"version": "10.
|
|
9
|
+
"version": "10.9.2",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@google-cloud/pubsub": "^2.18.4",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"exit-code": "^1.0.2",
|
|
31
31
|
"express": "^4.16.4",
|
|
32
32
|
"filesize": "^6.1.0",
|
|
33
|
-
"firebase-frameworks": "^0.
|
|
33
|
+
"firebase-frameworks": "^0.4.2",
|
|
34
34
|
"fs-extra": "^5.0.0",
|
|
35
35
|
"glob": "^7.1.2",
|
|
36
36
|
"google-auth-library": "^7.11.0",
|
|
@@ -6059,18 +6059,67 @@
|
|
|
6059
6059
|
}
|
|
6060
6060
|
},
|
|
6061
6061
|
"node_modules/firebase-frameworks": {
|
|
6062
|
-
"version": "0.
|
|
6063
|
-
"resolved": "https://registry.npmjs.org/firebase-frameworks/-/firebase-frameworks-0.
|
|
6064
|
-
"integrity": "sha512-
|
|
6062
|
+
"version": "0.4.2",
|
|
6063
|
+
"resolved": "https://registry.npmjs.org/firebase-frameworks/-/firebase-frameworks-0.4.2.tgz",
|
|
6064
|
+
"integrity": "sha512-a3xNE3wPh8JWq2WOgWlSypVS9O/y/3/3Im9EV7bNBF44wFV2oOAyFdVgDk6it81+lBRv7ci8PttgQZohtsFeVA==",
|
|
6065
6065
|
"dependencies": {
|
|
6066
|
+
"fs-extra": "^10.1.0",
|
|
6067
|
+
"jsonc-parser": "^3.0.0",
|
|
6068
|
+
"semver": "^7.3.7",
|
|
6066
6069
|
"tslib": "^2.3.1"
|
|
6067
6070
|
}
|
|
6068
6071
|
},
|
|
6072
|
+
"node_modules/firebase-frameworks/node_modules/fs-extra": {
|
|
6073
|
+
"version": "10.1.0",
|
|
6074
|
+
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz",
|
|
6075
|
+
"integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==",
|
|
6076
|
+
"dependencies": {
|
|
6077
|
+
"graceful-fs": "^4.2.0",
|
|
6078
|
+
"jsonfile": "^6.0.1",
|
|
6079
|
+
"universalify": "^2.0.0"
|
|
6080
|
+
},
|
|
6081
|
+
"engines": {
|
|
6082
|
+
"node": ">=12"
|
|
6083
|
+
}
|
|
6084
|
+
},
|
|
6085
|
+
"node_modules/firebase-frameworks/node_modules/jsonfile": {
|
|
6086
|
+
"version": "6.1.0",
|
|
6087
|
+
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
|
|
6088
|
+
"integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
|
|
6089
|
+
"dependencies": {
|
|
6090
|
+
"universalify": "^2.0.0"
|
|
6091
|
+
},
|
|
6092
|
+
"optionalDependencies": {
|
|
6093
|
+
"graceful-fs": "^4.1.6"
|
|
6094
|
+
}
|
|
6095
|
+
},
|
|
6096
|
+
"node_modules/firebase-frameworks/node_modules/semver": {
|
|
6097
|
+
"version": "7.3.7",
|
|
6098
|
+
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz",
|
|
6099
|
+
"integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==",
|
|
6100
|
+
"dependencies": {
|
|
6101
|
+
"lru-cache": "^6.0.0"
|
|
6102
|
+
},
|
|
6103
|
+
"bin": {
|
|
6104
|
+
"semver": "bin/semver.js"
|
|
6105
|
+
},
|
|
6106
|
+
"engines": {
|
|
6107
|
+
"node": ">=10"
|
|
6108
|
+
}
|
|
6109
|
+
},
|
|
6069
6110
|
"node_modules/firebase-frameworks/node_modules/tslib": {
|
|
6070
6111
|
"version": "2.3.1",
|
|
6071
6112
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
|
6072
6113
|
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
|
|
6073
6114
|
},
|
|
6115
|
+
"node_modules/firebase-frameworks/node_modules/universalify": {
|
|
6116
|
+
"version": "2.0.0",
|
|
6117
|
+
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
|
|
6118
|
+
"integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
|
|
6119
|
+
"engines": {
|
|
6120
|
+
"node": ">= 10.0.0"
|
|
6121
|
+
}
|
|
6122
|
+
},
|
|
6074
6123
|
"node_modules/firebase-functions": {
|
|
6075
6124
|
"version": "3.18.1",
|
|
6076
6125
|
"resolved": "https://registry.npmjs.org/firebase-functions/-/firebase-functions-3.18.1.tgz",
|
|
@@ -7945,6 +7994,11 @@
|
|
|
7945
7994
|
"node": ">=6"
|
|
7946
7995
|
}
|
|
7947
7996
|
},
|
|
7997
|
+
"node_modules/jsonc-parser": {
|
|
7998
|
+
"version": "3.0.0",
|
|
7999
|
+
"resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.0.0.tgz",
|
|
8000
|
+
"integrity": "sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA=="
|
|
8001
|
+
},
|
|
7948
8002
|
"node_modules/jsonfile": {
|
|
7949
8003
|
"version": "4.0.0",
|
|
7950
8004
|
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
|
|
@@ -18400,17 +18454,52 @@
|
|
|
18400
18454
|
}
|
|
18401
18455
|
},
|
|
18402
18456
|
"firebase-frameworks": {
|
|
18403
|
-
"version": "0.
|
|
18404
|
-
"resolved": "https://registry.npmjs.org/firebase-frameworks/-/firebase-frameworks-0.
|
|
18405
|
-
"integrity": "sha512-
|
|
18457
|
+
"version": "0.4.2",
|
|
18458
|
+
"resolved": "https://registry.npmjs.org/firebase-frameworks/-/firebase-frameworks-0.4.2.tgz",
|
|
18459
|
+
"integrity": "sha512-a3xNE3wPh8JWq2WOgWlSypVS9O/y/3/3Im9EV7bNBF44wFV2oOAyFdVgDk6it81+lBRv7ci8PttgQZohtsFeVA==",
|
|
18406
18460
|
"requires": {
|
|
18461
|
+
"fs-extra": "^10.1.0",
|
|
18462
|
+
"jsonc-parser": "^3.0.0",
|
|
18463
|
+
"semver": "^7.3.7",
|
|
18407
18464
|
"tslib": "^2.3.1"
|
|
18408
18465
|
},
|
|
18409
18466
|
"dependencies": {
|
|
18467
|
+
"fs-extra": {
|
|
18468
|
+
"version": "10.1.0",
|
|
18469
|
+
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz",
|
|
18470
|
+
"integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==",
|
|
18471
|
+
"requires": {
|
|
18472
|
+
"graceful-fs": "^4.2.0",
|
|
18473
|
+
"jsonfile": "^6.0.1",
|
|
18474
|
+
"universalify": "^2.0.0"
|
|
18475
|
+
}
|
|
18476
|
+
},
|
|
18477
|
+
"jsonfile": {
|
|
18478
|
+
"version": "6.1.0",
|
|
18479
|
+
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
|
|
18480
|
+
"integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
|
|
18481
|
+
"requires": {
|
|
18482
|
+
"graceful-fs": "^4.1.6",
|
|
18483
|
+
"universalify": "^2.0.0"
|
|
18484
|
+
}
|
|
18485
|
+
},
|
|
18486
|
+
"semver": {
|
|
18487
|
+
"version": "7.3.7",
|
|
18488
|
+
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz",
|
|
18489
|
+
"integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==",
|
|
18490
|
+
"requires": {
|
|
18491
|
+
"lru-cache": "^6.0.0"
|
|
18492
|
+
}
|
|
18493
|
+
},
|
|
18410
18494
|
"tslib": {
|
|
18411
18495
|
"version": "2.3.1",
|
|
18412
18496
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
|
18413
18497
|
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
|
|
18498
|
+
},
|
|
18499
|
+
"universalify": {
|
|
18500
|
+
"version": "2.0.0",
|
|
18501
|
+
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
|
|
18502
|
+
"integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ=="
|
|
18414
18503
|
}
|
|
18415
18504
|
}
|
|
18416
18505
|
},
|
|
@@ -19883,6 +19972,11 @@
|
|
|
19883
19972
|
"minimist": "^1.2.5"
|
|
19884
19973
|
}
|
|
19885
19974
|
},
|
|
19975
|
+
"jsonc-parser": {
|
|
19976
|
+
"version": "3.0.0",
|
|
19977
|
+
"resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.0.0.tgz",
|
|
19978
|
+
"integrity": "sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA=="
|
|
19979
|
+
},
|
|
19886
19980
|
"jsonfile": {
|
|
19887
19981
|
"version": "4.0.0",
|
|
19888
19982
|
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "firebase-tools",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.9.2",
|
|
4
4
|
"description": "Command-Line Interface for Firebase",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"exit-code": "^1.0.2",
|
|
108
108
|
"express": "^4.16.4",
|
|
109
109
|
"filesize": "^6.1.0",
|
|
110
|
-
"firebase-frameworks": "^0.
|
|
110
|
+
"firebase-frameworks": "^0.4.2",
|
|
111
111
|
"fs-extra": "^5.0.0",
|
|
112
112
|
"glob": "^7.1.2",
|
|
113
113
|
"google-auth-library": "^7.11.0",
|
|
@@ -910,6 +910,9 @@
|
|
|
910
910
|
"site": {
|
|
911
911
|
"type": "string"
|
|
912
912
|
},
|
|
913
|
+
"source": {
|
|
914
|
+
"type": "string"
|
|
915
|
+
},
|
|
913
916
|
"target": {
|
|
914
917
|
"type": "string"
|
|
915
918
|
},
|
|
@@ -1392,6 +1395,9 @@
|
|
|
1392
1395
|
"site": {
|
|
1393
1396
|
"type": "string"
|
|
1394
1397
|
},
|
|
1398
|
+
"source": {
|
|
1399
|
+
"type": "string"
|
|
1400
|
+
},
|
|
1395
1401
|
"target": {
|
|
1396
1402
|
"type": "string"
|
|
1397
1403
|
},
|
|
@@ -1874,6 +1880,9 @@
|
|
|
1874
1880
|
"site": {
|
|
1875
1881
|
"type": "string"
|
|
1876
1882
|
},
|
|
1883
|
+
"source": {
|
|
1884
|
+
"type": "string"
|
|
1885
|
+
},
|
|
1877
1886
|
"target": {
|
|
1878
1887
|
"type": "string"
|
|
1879
1888
|
},
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
"description": "Greet the world",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"firebase-admin": "^
|
|
7
|
-
"firebase-functions": "^3.
|
|
6
|
+
"firebase-admin": "^10.2.0",
|
|
7
|
+
"firebase-functions": "^3.21.0"
|
|
8
8
|
},
|
|
9
9
|
"devDependencies": {
|
|
10
|
-
"eslint": "^
|
|
11
|
-
"eslint-plugin-promise": "^
|
|
10
|
+
"eslint": "^8.15.1",
|
|
11
|
+
"eslint-plugin-promise": "^6.0.0"
|
|
12
12
|
},
|
|
13
13
|
"scripts": {
|
|
14
14
|
"lint": "./node_modules/.bin/eslint --max-warnings=0 .."
|
|
15
15
|
},
|
|
16
16
|
"private": true
|
|
17
|
-
}
|
|
17
|
+
}
|
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
},
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"firebase-admin": "^
|
|
11
|
-
"firebase-functions": "^3.
|
|
10
|
+
"firebase-admin": "^10.2.0",
|
|
11
|
+
"firebase-functions": "^3.21.0"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"eslint": "^
|
|
15
|
-
"eslint-plugin-import": "^2.
|
|
16
|
-
"typescript": "^
|
|
14
|
+
"eslint": "^8.15.1",
|
|
15
|
+
"eslint-plugin-import": "^2.26.0",
|
|
16
|
+
"typescript": "^4.6.4"
|
|
17
17
|
},
|
|
18
18
|
"private": true
|
|
19
|
-
}
|
|
19
|
+
}
|
|
@@ -14,12 +14,11 @@
|
|
|
14
14
|
},
|
|
15
15
|
"main": "lib/index.js",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"firebase-admin": "^10.0
|
|
18
|
-
"firebase-functions": "^3.
|
|
17
|
+
"firebase-admin": "^10.2.0",
|
|
18
|
+
"firebase-functions": "^3.21.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"typescript": "^4.
|
|
22
|
-
"firebase-functions-test": "^0.2.0"
|
|
21
|
+
"typescript": "^4.6.4"
|
|
23
22
|
},
|
|
24
23
|
"private": true
|
|
25
|
-
}
|
|
24
|
+
}
|