firebase-tools-with-isolate 15.27.0 → 15.28.1
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/ext-export.js +85 -20
- package/lib/commands/ext-uninstall.js +35 -1
- package/lib/commands/functions-delete.js +19 -5
- package/lib/commands/functions-kits-install.js +228 -105
- package/lib/commands/functions-kits-list.js +27 -0
- package/lib/commands/index.js +1 -0
- package/lib/dataconnect/client.js +11 -0
- package/lib/dataconnect/schemaMigration.js +16 -5
- package/lib/deploy/extensions/secrets.js +18 -0
- package/lib/deploy/functions/functionsDeployHelper.js +39 -15
- package/lib/deploy/functions/prepare.js +43 -9
- package/lib/deploy/functions/runtimes/dart/features.js +51 -0
- package/lib/deploy/functions/runtimes/dart/index.js +60 -16
- package/lib/emulator/downloadableEmulatorInfo.json +31 -31
- package/lib/emulator/functionsEmulator.js +4 -1
- package/lib/experiments.js +6 -0
- package/lib/extensions/export.js +26 -0
- package/lib/extensions/replacementRegistry.js +30 -0
- package/lib/extensions/replacements.json +464 -0
- package/lib/fetchMOTD.js +3 -0
- package/lib/functions/env.js +11 -0
- package/lib/functions/iac/export.js +16 -1
- package/lib/functions/kits/config.js +8 -0
- package/lib/gcp/secretManager.js +3 -3
- package/lib/init/features/functions/dart.js +1 -1
- package/lib/mcp/tools/core/deploy.js +2 -0
- package/lib/mcp/tools/core/login.js +59 -4
- package/lib/mcp/tools/dataconnect/compile.js +23 -2
- package/lib/mcp/tools/dataconnect/list_services.js +3 -4
- package/lib/tsconfig.publish.tsbuildinfo +1 -1
- package/lib/unzip.js +12 -2
- package/package.json +2 -1
- package/templates/init/functions/dart/_gitignore +1 -0
- package/templates/init/functions/typescript/index.ts +3 -3
- package/templates/init/functions/typescript/package-ongraphrequest.lint.json +3 -3
- package/templates/init/functions/typescript/package.lint.json +3 -3
- package/templates/init/functions/typescript/tsconfig.dev.json +4 -0
|
@@ -10,12 +10,13 @@ exports.inferBlockingDetails = inferBlockingDetails;
|
|
|
10
10
|
exports.resolveCpuAndConcurrency = resolveCpuAndConcurrency;
|
|
11
11
|
exports.resolveDefaultTimeout = resolveDefaultTimeout;
|
|
12
12
|
exports.loadCodebases = loadCodebases;
|
|
13
|
+
exports.getExecutablePaths = getExecutablePaths;
|
|
14
|
+
exports.stripStaleDartBuildIgnore = stripStaleDartBuildIgnore;
|
|
13
15
|
exports.warnIfNewGenkitFunctionIsMissingSecrets = warnIfNewGenkitFunctionIsMissingSecrets;
|
|
14
16
|
exports.ensureAllRequiredAPIsEnabled = ensureAllRequiredAPIsEnabled;
|
|
15
17
|
exports.partitionUserEnvs = partitionUserEnvs;
|
|
16
18
|
exports.checkKitForGen1 = checkKitForGen1;
|
|
17
19
|
const clc = require("colorette");
|
|
18
|
-
const proto = require("../../gcp/proto");
|
|
19
20
|
const backend = require("./backend");
|
|
20
21
|
const build = require("./build");
|
|
21
22
|
const experiments = require("../../experiments");
|
|
@@ -31,6 +32,8 @@ const api_1 = require("../../api");
|
|
|
31
32
|
const functionsDeployHelper_1 = require("./functionsDeployHelper");
|
|
32
33
|
const utils_1 = require("../../utils");
|
|
33
34
|
const triggerSupport_1 = require("./runtimes/dart/triggerSupport");
|
|
35
|
+
const dart_1 = require("./runtimes/dart");
|
|
36
|
+
const features_1 = require("./runtimes/dart/features");
|
|
34
37
|
const prepareFunctionsUpload_1 = require("./prepareFunctionsUpload");
|
|
35
38
|
const prompts_1 = require("./prompts");
|
|
36
39
|
const projectUtils_1 = require("../../projectUtils");
|
|
@@ -197,11 +200,9 @@ async function prepare(context, options, payload) {
|
|
|
197
200
|
projectAlias: options.projectAlias,
|
|
198
201
|
projectDir: options.config.projectDir,
|
|
199
202
|
};
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
else {
|
|
204
|
-
proto.convertIfPresent(userEnvOpt, localCfg, "configDir", (cd) => options.config.path(cd));
|
|
203
|
+
const configDir = (0, projectConfig_1.resolveConfigDir)(localCfg, codebase);
|
|
204
|
+
if (configDir) {
|
|
205
|
+
userEnvOpt.configDir = options.config.path(configDir);
|
|
205
206
|
}
|
|
206
207
|
const rawUserEnvs = functionsEnv.loadUserEnvs(userEnvOpt);
|
|
207
208
|
const { userEnvs: userEnvs, secretRefs: secretRefs } = partitionUserEnvs(rawUserEnvs);
|
|
@@ -303,9 +304,9 @@ async function prepare(context, options, payload) {
|
|
|
303
304
|
const exportType = backend.someEndpoint(wantBackend, (e) => e.platform === "run")
|
|
304
305
|
? "tar.gz"
|
|
305
306
|
: "zip";
|
|
306
|
-
const
|
|
307
|
-
const
|
|
308
|
-
const packagedSource = await (0, prepareFunctionsUpload_1.prepareFunctionsUpload)(options.config.projectDir, sourceDir,
|
|
307
|
+
const executablePaths = await getExecutablePaths(wantBuilds[codebase].runtime, sourceDir);
|
|
308
|
+
const uploadCfg = await stripStaleDartBuildIgnore(wantBuilds[codebase].runtime, sourceDir, localCfg);
|
|
309
|
+
const packagedSource = await (0, prepareFunctionsUpload_1.prepareFunctionsUpload)(options.config.projectDir, sourceDir, uploadCfg, [...schPathSet], undefined, { exportType, executablePaths });
|
|
309
310
|
source.functionsSourceV2 = packagedSource?.pathToSource;
|
|
310
311
|
source.functionsSourceV2Hash = packagedSource?.hash;
|
|
311
312
|
}
|
|
@@ -511,12 +512,24 @@ async function loadCodebases(config, options, firebaseConfig, runtimeConfig, fil
|
|
|
511
512
|
await runtimeDelegate.validate();
|
|
512
513
|
logger_1.logger.debug(`Building ${runtimeDelegate.language} source`);
|
|
513
514
|
await runtimeDelegate.build();
|
|
515
|
+
const userEnvOpt = {
|
|
516
|
+
functionsSource: sourceDir,
|
|
517
|
+
projectId: projectId,
|
|
518
|
+
projectAlias: options.projectAlias,
|
|
519
|
+
projectDir: options.config.projectDir,
|
|
520
|
+
};
|
|
521
|
+
const configDir = (0, projectConfig_1.resolveConfigDir)(codebaseConfig, codebase);
|
|
522
|
+
if (configDir) {
|
|
523
|
+
userEnvOpt.configDir = options.config.path(configDir);
|
|
524
|
+
}
|
|
525
|
+
const userEnvs = functionsEnv.loadUserEnvs(userEnvOpt);
|
|
514
526
|
const firebaseEnvs = functionsEnv.loadFirebaseEnvs(firebaseConfig, projectId, (0, projectConfig_1.isKitConfig)(codebaseConfig) ? codebase : undefined);
|
|
515
527
|
(0, utils_1.logLabeledBullet)("functions", `Loading and analyzing source code for codebase ${codebase} to determine what to deploy`);
|
|
516
528
|
const codebaseRuntimeConfig = (0, projectConfig_1.shouldUseRuntimeConfig)(codebaseConfig)
|
|
517
529
|
? runtimeConfig
|
|
518
530
|
: { firebase: firebaseConfig };
|
|
519
531
|
const discoveredBuild = await runtimeDelegate.discoverBuild(codebaseRuntimeConfig, {
|
|
532
|
+
...userEnvs,
|
|
520
533
|
...firebaseEnvs,
|
|
521
534
|
GOOGLE_CLOUD_QUOTA_PROJECT: projectId,
|
|
522
535
|
});
|
|
@@ -542,6 +555,27 @@ function warnIfDartBackendHasUnsupportedTriggers(want) {
|
|
|
542
555
|
"See https://github.com/firebase/firebase-functions-dart for current trigger support.");
|
|
543
556
|
}
|
|
544
557
|
}
|
|
558
|
+
async function getExecutablePaths(runtime, sourceDir) {
|
|
559
|
+
if (!supported.runtimeIsLanguage(runtime, "dart")) {
|
|
560
|
+
return [];
|
|
561
|
+
}
|
|
562
|
+
const features = await features_1.DartVersionFeatures.detect(sourceDir);
|
|
563
|
+
return features.isNativeAssetsAvailable ? [dart_1.DART_BUNDLE_EXECUTABLE_PATH] : [dart_1.DART_COMPILE_EXE_PATH];
|
|
564
|
+
}
|
|
565
|
+
async function stripStaleDartBuildIgnore(runtime, sourceDir, localCfg) {
|
|
566
|
+
if (!supported.runtimeIsLanguage(runtime, "dart") ||
|
|
567
|
+
!localCfg.ignore?.some((i) => i === "build" || i === "build/")) {
|
|
568
|
+
return localCfg;
|
|
569
|
+
}
|
|
570
|
+
const features = await features_1.DartVersionFeatures.detect(sourceDir);
|
|
571
|
+
if (!features.isNativeAssetsAvailable) {
|
|
572
|
+
return localCfg;
|
|
573
|
+
}
|
|
574
|
+
return {
|
|
575
|
+
...localCfg,
|
|
576
|
+
ignore: localCfg.ignore.filter((i) => i !== "build" && i !== "build/"),
|
|
577
|
+
};
|
|
578
|
+
}
|
|
545
579
|
async function warnIfNewGenkitFunctionIsMissingSecrets(have, want, options) {
|
|
546
580
|
if (options.force) {
|
|
547
581
|
return;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DartVersionFeatures = void 0;
|
|
4
|
+
const fs = require("fs");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
const MIN_DART_SDK_VERSION = "3.9.0";
|
|
7
|
+
const MIN_DART_SDK_VERSION_NATIVE_ASSETS = "3.13.0";
|
|
8
|
+
class DartVersionFeatures {
|
|
9
|
+
constructor(languageVersion) {
|
|
10
|
+
this.languageVersion = languageVersion;
|
|
11
|
+
}
|
|
12
|
+
static async detect(sourceDir) {
|
|
13
|
+
return new DartVersionFeatures(await readRootLanguageVersion(sourceDir));
|
|
14
|
+
}
|
|
15
|
+
get isNativeAssetsAvailable() {
|
|
16
|
+
return this.atLeast(3, 13);
|
|
17
|
+
}
|
|
18
|
+
get minDartSdkVersion() {
|
|
19
|
+
return this.isNativeAssetsAvailable ? MIN_DART_SDK_VERSION_NATIVE_ASSETS : MIN_DART_SDK_VERSION;
|
|
20
|
+
}
|
|
21
|
+
atLeast(major, minor) {
|
|
22
|
+
if (!this.languageVersion) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
const [actualMajor, actualMinor] = this.languageVersion;
|
|
26
|
+
return actualMajor > major || (actualMajor === major && actualMinor >= minor);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.DartVersionFeatures = DartVersionFeatures;
|
|
30
|
+
async function readRootLanguageVersion(sourceDir) {
|
|
31
|
+
const packageConfigPath = path.join(sourceDir, ".dart_tool", "package_config.json");
|
|
32
|
+
let raw;
|
|
33
|
+
try {
|
|
34
|
+
raw = await fs.promises.readFile(packageConfigPath, "utf8");
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
try {
|
|
40
|
+
const parsed = JSON.parse(raw);
|
|
41
|
+
const root = parsed?.packages?.find((p) => p.rootUri === "../");
|
|
42
|
+
const match = root?.languageVersion ? /^(\d+)\.(\d+)$/.exec(root.languageVersion) : null;
|
|
43
|
+
if (!match) {
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
return [Number(match[1]), Number(match[2])];
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Delegate = exports.DART_ENTRY_POINT = void 0;
|
|
3
|
+
exports.Delegate = exports.DART_BUNDLE_EXECUTABLE_PATH = exports.DART_COMPILE_EXE_PATH = exports.DART_ENTRY_POINT = void 0;
|
|
4
4
|
exports.tryCreateDelegate = tryCreateDelegate;
|
|
5
5
|
const fs = require("fs");
|
|
6
6
|
const path = require("path");
|
|
@@ -14,6 +14,7 @@ const utils_1 = require("../../../../utils");
|
|
|
14
14
|
const registry_1 = require("../../../../emulator/registry");
|
|
15
15
|
const types_1 = require("../../../../emulator/types");
|
|
16
16
|
const experiments = require("../../../../experiments");
|
|
17
|
+
const features_1 = require("./features");
|
|
17
18
|
async function tryCreateDelegate(context) {
|
|
18
19
|
const pubspecYamlPath = path.join(context.sourceDir, "pubspec.yaml");
|
|
19
20
|
if (!(await (0, util_1.promisify)(fs.exists)(pubspecYamlPath))) {
|
|
@@ -30,8 +31,9 @@ async function tryCreateDelegate(context) {
|
|
|
30
31
|
}
|
|
31
32
|
return Promise.resolve(new Delegate(context.projectId, context.sourceDir, runtime));
|
|
32
33
|
}
|
|
33
|
-
const MIN_DART_SDK_VERSION = "3.9.0";
|
|
34
34
|
exports.DART_ENTRY_POINT = "bin/server.dart";
|
|
35
|
+
exports.DART_COMPILE_EXE_PATH = "bin/server";
|
|
36
|
+
exports.DART_BUNDLE_EXECUTABLE_PATH = "build/cli/linux_x64/bundle/bin/server";
|
|
35
37
|
class Delegate {
|
|
36
38
|
constructor(projectId, sourceDir, runtime) {
|
|
37
39
|
this.projectId = projectId;
|
|
@@ -51,18 +53,6 @@ class Delegate {
|
|
|
51
53
|
throw new error_1.FirebaseError(`Could not find a Dart SDK. Make sure the '${this.bin}' command is available on your PATH.`);
|
|
52
54
|
}
|
|
53
55
|
const versionOutput = (result.stdout || result.stderr || "").toString();
|
|
54
|
-
const match = /Dart SDK version:\s*(\d+\.\d+\.\d+)/.exec(versionOutput);
|
|
55
|
-
if (match) {
|
|
56
|
-
const installedVersion = match[1];
|
|
57
|
-
if (installedVersion.localeCompare(MIN_DART_SDK_VERSION, undefined, { numeric: true }) < 0) {
|
|
58
|
-
throw new error_1.FirebaseError(`Dart SDK version ${installedVersion} is not supported. ` +
|
|
59
|
-
`Firebase Functions for Dart requires Dart ${MIN_DART_SDK_VERSION} or later. ` +
|
|
60
|
-
`Please upgrade your Dart SDK.`);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
logger_1.logger.debug(`Could not parse Dart SDK version from: ${versionOutput}`);
|
|
65
|
-
}
|
|
66
56
|
const pubspecYamlPath = path.join(this.sourceDir, "pubspec.yaml");
|
|
67
57
|
try {
|
|
68
58
|
await fs.promises.access(pubspecYamlPath, fs.constants.R_OK);
|
|
@@ -107,6 +97,20 @@ class Delegate {
|
|
|
107
97
|
pubGetProcess.on("error", reject);
|
|
108
98
|
});
|
|
109
99
|
}
|
|
100
|
+
const match = /Dart SDK version:\s*(\d+\.\d+\.\d+)/.exec(versionOutput);
|
|
101
|
+
if (match) {
|
|
102
|
+
const installedVersion = match[1];
|
|
103
|
+
const features = await features_1.DartVersionFeatures.detect(this.sourceDir);
|
|
104
|
+
const minVersion = features.minDartSdkVersion;
|
|
105
|
+
if (installedVersion.localeCompare(minVersion, undefined, { numeric: true }) < 0) {
|
|
106
|
+
throw new error_1.FirebaseError(`Dart SDK version ${installedVersion} is not supported. ` +
|
|
107
|
+
`Firebase Functions for Dart requires Dart ${minVersion} or later. ` +
|
|
108
|
+
`Please upgrade your Dart SDK.`);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
logger_1.logger.debug(`Could not parse Dart SDK version from: ${versionOutput}`);
|
|
113
|
+
}
|
|
110
114
|
}
|
|
111
115
|
async build() {
|
|
112
116
|
if (Delegate.watchModeActive) {
|
|
@@ -139,6 +143,15 @@ class Delegate {
|
|
|
139
143
|
logger_1.logger.debug("Skipping Dart compilation in emulator mode.");
|
|
140
144
|
return;
|
|
141
145
|
}
|
|
146
|
+
const features = await features_1.DartVersionFeatures.detect(this.sourceDir);
|
|
147
|
+
if (features.isNativeAssetsAvailable) {
|
|
148
|
+
await this.buildCli();
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
await this.compileExe();
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
async compileExe() {
|
|
142
155
|
const binDir = path.join(this.sourceDir, "bin");
|
|
143
156
|
await fs.promises.mkdir(binDir, { recursive: true });
|
|
144
157
|
(0, utils_1.logLabeledBullet)("functions", "compiling Dart to linux-x64 executable...");
|
|
@@ -147,7 +160,7 @@ class Delegate {
|
|
|
147
160
|
"exe",
|
|
148
161
|
this.entryPoint,
|
|
149
162
|
"-o",
|
|
150
|
-
|
|
163
|
+
exports.DART_COMPILE_EXE_PATH,
|
|
151
164
|
"--target-os=linux",
|
|
152
165
|
"--target-arch=x64",
|
|
153
166
|
], {
|
|
@@ -168,13 +181,43 @@ class Delegate {
|
|
|
168
181
|
else {
|
|
169
182
|
reject(new error_1.FirebaseError(`Dart compilation failed with exit code ${code}. ` +
|
|
170
183
|
`Make sure your Dart project compiles successfully with: ` +
|
|
171
|
-
`dart compile exe ${this.entryPoint} --target-os=linux --target-arch=x64`
|
|
184
|
+
`dart compile exe ${this.entryPoint} --target-os=linux --target-arch=x64\n` +
|
|
185
|
+
`If your dependencies require native build hooks (e.g. sqlite3), bump the ` +
|
|
186
|
+
`SDK constraint in your pubspec.yaml's "environment" section to "^3.13.0" or ` +
|
|
187
|
+
`later to use dart build cli instead.`));
|
|
172
188
|
}
|
|
173
189
|
});
|
|
174
190
|
compileProcess.on("error", reject);
|
|
175
191
|
});
|
|
176
192
|
(0, utils_1.logLabeledBullet)("functions", "Dart compilation complete.");
|
|
177
193
|
}
|
|
194
|
+
async buildCli() {
|
|
195
|
+
(0, utils_1.logLabeledBullet)("functions", "building Dart linux-x64 bundle...");
|
|
196
|
+
const buildProcess = spawn(this.bin, ["build", "cli", "--target", this.entryPoint, "--target-os", "linux", "--target-arch", "x64"], {
|
|
197
|
+
cwd: this.sourceDir,
|
|
198
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
199
|
+
});
|
|
200
|
+
buildProcess.stdout?.on("data", (chunk) => {
|
|
201
|
+
logger_1.logger.debug(`[dart build cli] ${chunk.toString("utf8").trim()}`);
|
|
202
|
+
});
|
|
203
|
+
buildProcess.stderr?.on("data", (chunk) => {
|
|
204
|
+
logger_1.logger.debug(`[dart build cli] ${chunk.toString("utf8").trim()}`);
|
|
205
|
+
});
|
|
206
|
+
await new Promise((resolve, reject) => {
|
|
207
|
+
buildProcess.on("exit", (code) => {
|
|
208
|
+
if (code === 0 || code === null) {
|
|
209
|
+
resolve();
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
reject(new error_1.FirebaseError(`Dart build failed with exit code ${code}. ` +
|
|
213
|
+
`Make sure your Dart project builds successfully with: ` +
|
|
214
|
+
`dart build cli --target ${this.entryPoint} --target-os linux --target-arch x64`));
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
buildProcess.on("error", reject);
|
|
218
|
+
});
|
|
219
|
+
(0, utils_1.logLabeledBullet)("functions", "Dart build complete.");
|
|
220
|
+
}
|
|
178
221
|
async watch(onRebuild) {
|
|
179
222
|
Delegate.watchModeActive = true;
|
|
180
223
|
logger_1.logger.debug("Starting build_runner watch for Dart functions...");
|
|
@@ -245,6 +288,7 @@ class Delegate {
|
|
|
245
288
|
const buildRunnerProcess = spawn(this.bin, ["run", "build_runner", "build"], {
|
|
246
289
|
cwd: this.sourceDir,
|
|
247
290
|
stdio: ["ignore", "pipe", "pipe"],
|
|
291
|
+
env: { ...process.env, ...envs },
|
|
248
292
|
});
|
|
249
293
|
buildRunnerProcess.stdout?.on("data", (chunk) => {
|
|
250
294
|
logger_1.logger.debug(`[build_runner] ${chunk.toString("utf8")}`);
|
|
@@ -44,46 +44,46 @@
|
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
46
|
"pubsub": {
|
|
47
|
-
"version": "0.8.
|
|
48
|
-
"expectedSize":
|
|
49
|
-
"expectedChecksum": "
|
|
50
|
-
"expectedChecksumSHA256": "
|
|
51
|
-
"remoteUrl": "https://storage.googleapis.com/firebase-preview-drop/emulator/pubsub-emulator-0.8.
|
|
52
|
-
"downloadPathRelativeToCacheDir": "pubsub-emulator-0.8.
|
|
53
|
-
"binaryPathRelativeToCacheDir": "pubsub-emulator-0.8.
|
|
47
|
+
"version": "0.8.35",
|
|
48
|
+
"expectedSize": 53015972,
|
|
49
|
+
"expectedChecksum": "04cb782e3edf7a2b117990af8506453e",
|
|
50
|
+
"expectedChecksumSHA256": "b0f3b73a14b716ecf8925b7b8a0c8c858ffabddcf03df8b2b7fba682f48dc616",
|
|
51
|
+
"remoteUrl": "https://storage.googleapis.com/firebase-preview-drop/emulator/pubsub-emulator-0.8.35.zip",
|
|
52
|
+
"downloadPathRelativeToCacheDir": "pubsub-emulator-0.8.35.zip",
|
|
53
|
+
"binaryPathRelativeToCacheDir": "pubsub-emulator-0.8.35/pubsub-emulator/bin/cloud-pubsub-emulator"
|
|
54
54
|
},
|
|
55
55
|
"dataconnect": {
|
|
56
56
|
"darwin": {
|
|
57
|
-
"version": "3.4.
|
|
58
|
-
"expectedSize":
|
|
59
|
-
"expectedChecksum": "
|
|
60
|
-
"expectedChecksumSHA256": "
|
|
61
|
-
"remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-macos-amd64-v3.4.
|
|
62
|
-
"downloadPathRelativeToCacheDir": "dataconnect-emulator-3.4.
|
|
57
|
+
"version": "3.4.18",
|
|
58
|
+
"expectedSize": 33375408,
|
|
59
|
+
"expectedChecksum": "e38f131497fc43df55c3a47ee87e7fd4",
|
|
60
|
+
"expectedChecksumSHA256": "52518fefdd2e52581b0d8d035c6498f304ac493d3757f4fd35851b1f028a9460",
|
|
61
|
+
"remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-macos-amd64-v3.4.18",
|
|
62
|
+
"downloadPathRelativeToCacheDir": "dataconnect-emulator-3.4.18"
|
|
63
63
|
},
|
|
64
64
|
"darwin_arm64": {
|
|
65
|
-
"version": "3.4.
|
|
66
|
-
"expectedSize":
|
|
67
|
-
"expectedChecksum": "
|
|
68
|
-
"expectedChecksumSHA256": "
|
|
69
|
-
"remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-macos-arm64-v3.4.
|
|
70
|
-
"downloadPathRelativeToCacheDir": "dataconnect-emulator-3.4.
|
|
65
|
+
"version": "3.4.18",
|
|
66
|
+
"expectedSize": 31505922,
|
|
67
|
+
"expectedChecksum": "6a7cfdd68a7671bb660eb8489372a890",
|
|
68
|
+
"expectedChecksumSHA256": "96cdec1fd6561af5c10f915f6f3bfd59a7405bf5e9b8fabfedb40cd57d6d5d76",
|
|
69
|
+
"remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-macos-arm64-v3.4.18",
|
|
70
|
+
"downloadPathRelativeToCacheDir": "dataconnect-emulator-3.4.18"
|
|
71
71
|
},
|
|
72
72
|
"win32": {
|
|
73
|
-
"version": "3.4.
|
|
74
|
-
"expectedSize":
|
|
75
|
-
"expectedChecksum": "
|
|
76
|
-
"expectedChecksumSHA256": "
|
|
77
|
-
"remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-windows-amd64-v3.4.
|
|
78
|
-
"downloadPathRelativeToCacheDir": "dataconnect-emulator-3.4.
|
|
73
|
+
"version": "3.4.18",
|
|
74
|
+
"expectedSize": 33414144,
|
|
75
|
+
"expectedChecksum": "d2504c643ac8355b90aa31be7575807c",
|
|
76
|
+
"expectedChecksumSHA256": "a92f2d01950af613d28b92c2cd7baa85e7629fa201b8ff8dddce73d5584dccc5",
|
|
77
|
+
"remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-windows-amd64-v3.4.18",
|
|
78
|
+
"downloadPathRelativeToCacheDir": "dataconnect-emulator-3.4.18.exe"
|
|
79
79
|
},
|
|
80
80
|
"linux": {
|
|
81
|
-
"version": "3.4.
|
|
82
|
-
"expectedSize":
|
|
83
|
-
"expectedChecksum": "
|
|
84
|
-
"expectedChecksumSHA256": "
|
|
85
|
-
"remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-linux-amd64-v3.4.
|
|
86
|
-
"downloadPathRelativeToCacheDir": "dataconnect-emulator-3.4.
|
|
81
|
+
"version": "3.4.18",
|
|
82
|
+
"expectedSize": 32510136,
|
|
83
|
+
"expectedChecksum": "c8b4640f3ea59c813a708814bd2c0f8c",
|
|
84
|
+
"expectedChecksumSHA256": "bb381de594485653812bee518ddae025c13e1050670d6fa186f6003c3c9b71ec",
|
|
85
|
+
"remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-linux-amd64-v3.4.18",
|
|
86
|
+
"downloadPathRelativeToCacheDir": "dataconnect-emulator-3.4.18"
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
}
|
|
@@ -370,7 +370,10 @@ class FunctionsEmulator {
|
|
|
370
370
|
projectDir: this.args.projectDir,
|
|
371
371
|
};
|
|
372
372
|
const userEnvs = functionsEnv.loadUserEnvs(userEnvOpt);
|
|
373
|
-
const discoveredBuild = await runtimeDelegate.discoverBuild(runtimeConfig,
|
|
373
|
+
const discoveredBuild = await runtimeDelegate.discoverBuild(runtimeConfig, {
|
|
374
|
+
...userEnvs,
|
|
375
|
+
...environment,
|
|
376
|
+
});
|
|
374
377
|
if (discoveredBuild.extensions && this.args.extensionsEmulator) {
|
|
375
378
|
await this.args.extensionsEmulator.addDynamicExtensions(emulatableBackend.codebase, discoveredBuild);
|
|
376
379
|
await this.loadDynamicExtensionBackends();
|
package/lib/experiments.js
CHANGED
|
@@ -221,6 +221,12 @@ exports.ALL_EXPERIMENTS = experiments({
|
|
|
221
221
|
default: false,
|
|
222
222
|
public: false,
|
|
223
223
|
},
|
|
224
|
+
fdcapimigration: {
|
|
225
|
+
shortDescription: "Enable the FDC API schema migration path.",
|
|
226
|
+
fullDescription: "API based Schema Migration behind experimental flag.",
|
|
227
|
+
default: true,
|
|
228
|
+
public: false,
|
|
229
|
+
},
|
|
224
230
|
});
|
|
225
231
|
function isValidExperiment(name) {
|
|
226
232
|
return Object.keys(exports.ALL_EXPERIMENTS).includes(name);
|
package/lib/extensions/export.js
CHANGED
|
@@ -4,11 +4,14 @@ exports.parameterizeProject = parameterizeProject;
|
|
|
4
4
|
exports.setSecretParamsToLatest = setSecretParamsToLatest;
|
|
5
5
|
exports.displayExportInfo = displayExportInfo;
|
|
6
6
|
exports.functionsEnvFromInstance = functionsEnvFromInstance;
|
|
7
|
+
exports.ejectSecretsFromInstance = ejectSecretsFromInstance;
|
|
7
8
|
const planner_1 = require("../deploy/extensions/planner");
|
|
8
9
|
const deploymentSummary_1 = require("../deploy/extensions/deploymentSummary");
|
|
9
10
|
const logger_1 = require("../logger");
|
|
10
11
|
const secretManager_1 = require("../gcp/secretManager");
|
|
11
12
|
const secretsUtils_1 = require("./secretsUtils");
|
|
13
|
+
const secrets_1 = require("../deploy/extensions/secrets");
|
|
14
|
+
const error_1 = require("../error");
|
|
12
15
|
function parameterizeProject(projectId, projectNumber, spec) {
|
|
13
16
|
const newParams = {};
|
|
14
17
|
for (const [key, val] of Object.entries(spec.params)) {
|
|
@@ -107,3 +110,26 @@ function functionsEnvFromInstance(instance) {
|
|
|
107
110
|
}
|
|
108
111
|
return envs;
|
|
109
112
|
}
|
|
113
|
+
async function ejectSecretsFromInstance(instance) {
|
|
114
|
+
const secretsChanged = [];
|
|
115
|
+
const liveParams = instance.config?.params || {};
|
|
116
|
+
for (const specParam of instance.config?.source?.spec?.params ?? []) {
|
|
117
|
+
if (specParam.type !== "SECRET") {
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
const secretName = specParam.param;
|
|
121
|
+
const resourceName = liveParams[secretName];
|
|
122
|
+
if (!resourceName) {
|
|
123
|
+
throw new error_1.FirebaseError(`Secret ${secretName} was defined in the extension spec, but is missing in live deployed secrets.`, { exit: 1 });
|
|
124
|
+
}
|
|
125
|
+
const match = resourceName.match(secretManager_1.SECRET_VERSION_NAME_REGEX);
|
|
126
|
+
if (!match?.groups) {
|
|
127
|
+
throw new error_1.FirebaseError(`Invalid secret version resource name [${resourceName}].`);
|
|
128
|
+
}
|
|
129
|
+
const projectId = match.groups.project;
|
|
130
|
+
const secretId = match.groups.secret;
|
|
131
|
+
await (0, secrets_1.transferSecretToKits)(projectId, secretId);
|
|
132
|
+
secretsChanged.push(`${projectId}/${secretId}`);
|
|
133
|
+
}
|
|
134
|
+
return secretsChanged;
|
|
135
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getExtensionReplacement = getExtensionReplacement;
|
|
4
|
+
exports.getDeprecationWarningMessage = getDeprecationWarningMessage;
|
|
5
|
+
const replacementsData = require("./replacements.json");
|
|
6
|
+
const DECOMMISSION_DATE_STR = "March 31, 2027";
|
|
7
|
+
const registry = replacementsData;
|
|
8
|
+
function getExtensionReplacement(extensionRef) {
|
|
9
|
+
if (!extensionRef) {
|
|
10
|
+
return undefined;
|
|
11
|
+
}
|
|
12
|
+
return registry.replacements?.[extensionRef];
|
|
13
|
+
}
|
|
14
|
+
function getDeprecationWarningMessage(extensionRef) {
|
|
15
|
+
const replacement = getExtensionReplacement(extensionRef);
|
|
16
|
+
if (!replacement) {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
switch (replacement.status) {
|
|
20
|
+
case "REPLACEMENT_AVAILABLE":
|
|
21
|
+
return (`Extension '${extensionRef}' is deprecated and will be decommissioned on ${DECOMMISSION_DATE_STR}.\n` +
|
|
22
|
+
` Recommended replacement: ${replacement.npmPackage}`);
|
|
23
|
+
case "CONFIRMED_NO_REPLACEMENT":
|
|
24
|
+
return (`Extension '${extensionRef}' is deprecated and will be decommissioned on ${DECOMMISSION_DATE_STR}.\n` +
|
|
25
|
+
` Note: No npm package replacement is planned for this extension.`);
|
|
26
|
+
case "PENDING_PUBLISHER":
|
|
27
|
+
return (`Extension '${extensionRef}' is deprecated and will be decommissioned on ${DECOMMISSION_DATE_STR}.\n` +
|
|
28
|
+
` A replacement package has not yet been announced by the publisher.`);
|
|
29
|
+
}
|
|
30
|
+
}
|