firebase-tools 13.15.1 → 13.15.3

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.
@@ -101,7 +101,8 @@ async function prepareHelper(context, options, payload, wantExtensions, noDelete
101
101
  async function prepareDynamicExtensions(context, options, payload, builds) {
102
102
  const filters = (0, functionsDeployHelper_1.getEndpointFilters)(options);
103
103
  const extensions = (0, common_1.extractExtensionsFromBuilds)(builds, filters);
104
- if (Object.keys(extensions).length === 0) {
104
+ const isApiEnabled = await (0, extensionsHelper_1.checkExtensionsApiEnabled)(options);
105
+ if (Object.keys(extensions).length === 0 && !isApiEnabled) {
105
106
  return;
106
107
  }
107
108
  const projectId = (0, projectUtils_1.needProjectId)(options);
@@ -109,9 +110,7 @@ async function prepareDynamicExtensions(context, options, payload, builds) {
109
110
  const aliases = (0, projectUtils_1.getAliases)(options, projectId);
110
111
  const projectDir = options.config.projectDir;
111
112
  const isPrimaryCall = !!options.only && !options.only.split(",").includes("extensions");
112
- if (isPrimaryCall) {
113
- await (0, extensionsHelper_1.ensureExtensionsApiEnabled)(options);
114
- }
113
+ await (0, extensionsHelper_1.ensureExtensionsApiEnabled)(options);
115
114
  await (0, requirePermissions_1.requirePermissions)(options, ["firebaseextensions.instances.list"]);
116
115
  const dynamicWant = await planner.wantDynamic({
117
116
  projectId,
@@ -11,6 +11,12 @@ const etags_1 = require("../../extensions/etags");
11
11
  const track_1 = require("../../track");
12
12
  async function release(context, options, payload) {
13
13
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
14
+ if (!payload.instancesToCreate &&
15
+ !payload.instancesToUpdate &&
16
+ !payload.instancesToConfigure &&
17
+ !payload.instancesToDelete) {
18
+ return;
19
+ }
14
20
  const projectId = (0, projectUtils_1.needProjectId)(options);
15
21
  const errorHandler = new errors_1.ErrorHandler();
16
22
  const deploymentQueue = new queue_1.default({
@@ -46,20 +46,20 @@ const EMULATOR_UPDATE_DETAILS = {
46
46
  },
47
47
  dataconnect: process.platform === "darwin"
48
48
  ? {
49
- version: "1.3.4",
50
- expectedSize: 24216320,
51
- expectedChecksum: "f57bc0b9a10837ecb4f2808c49ae3ff5",
49
+ version: "1.3.5",
50
+ expectedSize: 24232704,
51
+ expectedChecksum: "4eabf613a4a5feeaa173e1375b62bde0",
52
52
  }
53
53
  : process.platform === "win32"
54
54
  ? {
55
- version: "1.3.4",
56
- expectedSize: 24631296,
57
- expectedChecksum: "c8f1433fbff26f5e9da30cf205f2af78",
55
+ version: "1.3.5",
56
+ expectedSize: 24651264,
57
+ expectedChecksum: "c7b2b7168ff7226f4e5626ae7d13e0ca",
58
58
  }
59
59
  : {
60
- version: "1.3.4",
61
- expectedSize: 24125592,
62
- expectedChecksum: "a7b9a79d66fa5ebfb1a0f65e535d5c33",
60
+ version: "1.3.5",
61
+ expectedSize: 24146072,
62
+ expectedChecksum: "1457937751ce25fa332cdc16b561d64b",
63
63
  },
64
64
  };
65
65
  exports.DownloadDetails = {
@@ -7,7 +7,7 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
7
7
  function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
8
8
  };
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.diagnoseAndFixProject = exports.getSourceOrigin = exports.isLocalOrURLPath = exports.isLocalPath = exports.isUrlPath = exports.instanceIdExists = exports.promptForRepeatInstance = exports.promptForOfficialExtension = exports.displayReleaseNotes = exports.getPublisherProjectFromName = exports.createSourceFromLocation = exports.getMissingPublisherError = exports.uploadExtensionVersionFromLocalSource = exports.uploadExtensionVersionFromGitHubSource = exports.unpackExtensionState = exports.getNextVersionByStage = exports.ensureExtensionsPublisherApiEnabled = exports.ensureExtensionsApiEnabled = exports.promptForExtensionRoot = exports.promptForValidRepoURI = exports.promptForValidInstanceId = exports.validateSpec = exports.validateCommandLineParams = exports.populateDefaultParams = exports.substituteSecretParams = exports.substituteParams = exports.getFirebaseProjectParams = exports.getDBInstanceFromURL = exports.resourceTypeToNiceName = exports.AUTOPOULATED_PARAM_PLACEHOLDERS = exports.EXTENSIONS_BUCKET_NAME = exports.URL_REGEX = exports.logPrefix = exports.SourceOrigin = exports.SpecParamType = void 0;
10
+ exports.diagnoseAndFixProject = exports.getSourceOrigin = exports.isLocalOrURLPath = exports.isLocalPath = exports.isUrlPath = exports.instanceIdExists = exports.promptForRepeatInstance = exports.promptForOfficialExtension = exports.displayReleaseNotes = exports.getPublisherProjectFromName = exports.createSourceFromLocation = exports.getMissingPublisherError = exports.uploadExtensionVersionFromLocalSource = exports.uploadExtensionVersionFromGitHubSource = exports.unpackExtensionState = exports.getNextVersionByStage = exports.ensureExtensionsPublisherApiEnabled = exports.ensureExtensionsApiEnabled = exports.checkExtensionsApiEnabled = exports.promptForExtensionRoot = exports.promptForValidRepoURI = exports.promptForValidInstanceId = exports.validateSpec = exports.validateCommandLineParams = exports.populateDefaultParams = exports.substituteSecretParams = exports.substituteParams = exports.getFirebaseProjectParams = exports.getDBInstanceFromURL = exports.resourceTypeToNiceName = exports.AUTOPOULATED_PARAM_PLACEHOLDERS = exports.EXTENSIONS_BUCKET_NAME = exports.URL_REGEX = exports.logPrefix = exports.SourceOrigin = exports.SpecParamType = void 0;
11
11
  const clc = require("colorette");
12
12
  const ora = require("ora");
13
13
  const semver = require("semver");
@@ -385,6 +385,14 @@ async function promptForReleaseStage(args) {
385
385
  }
386
386
  return stage;
387
387
  }
388
+ async function checkExtensionsApiEnabled(options) {
389
+ const projectId = (0, projectUtils_1.getProjectId)(options);
390
+ if (!projectId) {
391
+ return false;
392
+ }
393
+ return await (0, ensureApiEnabled_1.check)(projectId, (0, api_1.extensionsOrigin)(), "extensions", options.markdown);
394
+ }
395
+ exports.checkExtensionsApiEnabled = checkExtensionsApiEnabled;
388
396
  async function ensureExtensionsApiEnabled(options) {
389
397
  const projectId = (0, projectUtils_1.getProjectId)(options);
390
398
  if (!projectId) {
@@ -22,6 +22,7 @@ const constants_1 = require("../constants");
22
22
  const constants_2 = require("./constants");
23
23
  const api_1 = require("../../hosting/api");
24
24
  const logger_1 = require("../../logger");
25
+ const env_1 = require("../../functions/env");
25
26
  const DEFAULT_BUILD_SCRIPT = ["next build"];
26
27
  const PUBLIC_DIR = "public";
27
28
  exports.supportedRange = "12 - 14.0";
@@ -50,7 +51,14 @@ async function build(dir, target, context) {
50
51
  if (reactVersion && (0, semver_1.gte)(reactVersion, "18.0.0")) {
51
52
  process.env.__NEXT_REACT_ROOT = "true";
52
53
  }
53
- const env = Object.assign({}, process.env);
54
+ let env = Object.assign({}, process.env);
55
+ if (context === null || context === void 0 ? void 0 : context.projectId) {
56
+ const projectEnvPath = (0, path_1.join)(dir, `.env.${context.projectId}`);
57
+ if (await (0, fs_extra_1.pathExists)(projectEnvPath)) {
58
+ const projectEnvVars = (0, env_1.parseStrict)((await (0, fs_extra_1.readFile)(projectEnvPath)).toString());
59
+ env = Object.assign(Object.assign({}, projectEnvVars), env);
60
+ }
61
+ }
54
62
  if ((context === null || context === void 0 ? void 0 : context.projectId) && (context === null || context === void 0 ? void 0 : context.site)) {
55
63
  const deploymentDomain = await (0, api_1.getDeploymentDomain)(context.projectId, context.site, context.hostingChannel);
56
64
  if (deploymentDomain) {
@@ -244,9 +244,13 @@ async function whichNextConfigFile(dir) {
244
244
  }
245
245
  exports.whichNextConfigFile = whichNextConfigFile;
246
246
  function findEsbuildPath() {
247
+ var _a;
247
248
  try {
248
- const esbuildBinPath = (0, child_process_1.execSync)("npx which esbuild", { encoding: "utf8" }).trim();
249
- const globalVersion = getGlobalEsbuildVersion();
249
+ const esbuildBinPath = (_a = (0, child_process_1.execSync)("npx which esbuild", { encoding: "utf8" })) === null || _a === void 0 ? void 0 : _a.trim();
250
+ if (!esbuildBinPath) {
251
+ return null;
252
+ }
253
+ const globalVersion = getGlobalEsbuildVersion(esbuildBinPath);
250
254
  if (globalVersion && !(0, semver_1.satisfies)(globalVersion, constants_1.ESBUILD_VERSION)) {
251
255
  console.warn(`Warning: Global esbuild version (${globalVersion}) does not match the required version (${constants_1.ESBUILD_VERSION}).`);
252
256
  }
@@ -258,9 +262,13 @@ function findEsbuildPath() {
258
262
  }
259
263
  }
260
264
  exports.findEsbuildPath = findEsbuildPath;
261
- function getGlobalEsbuildVersion() {
265
+ function getGlobalEsbuildVersion(binPath) {
266
+ var _a;
262
267
  try {
263
- const versionOutput = (0, child_process_1.execSync)("esbuild --version", { encoding: "utf8" }).trim();
268
+ const versionOutput = (_a = (0, child_process_1.execSync)(`${binPath} --version`, { encoding: "utf8" })) === null || _a === void 0 ? void 0 : _a.trim();
269
+ if (!versionOutput) {
270
+ return null;
271
+ }
264
272
  const versionMatch = versionOutput.match(/(\d+\.\d+\.\d+)/);
265
273
  return versionMatch ? versionMatch[0] : null;
266
274
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firebase-tools",
3
- "version": "13.15.1",
3
+ "version": "13.15.3",
4
4
  "description": "Command-Line Interface for Firebase",
5
5
  "main": "./lib/index.js",
6
6
  "bin": {
@@ -124,7 +124,7 @@
124
124
  "uuid": "^8.3.2",
125
125
  "winston": "^3.0.0",
126
126
  "winston-transport": "^4.4.0",
127
- "ws": "^7.2.3",
127
+ "ws": "^7.5.10",
128
128
  "yaml": "^2.4.1"
129
129
  }
130
130
  }