firebase-tools 15.34.2 → 15.36.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.
Files changed (126) hide show
  1. package/lib/api.js +2 -4
  2. package/lib/appcheck/debugTokens.js +293 -0
  3. package/lib/appcheck/localConfig.js +191 -0
  4. package/lib/appdistribution/options-parser-util.js +1 -1
  5. package/lib/apphosting/constants.js +1 -4
  6. package/lib/apphosting/githubConnections.js +1 -1
  7. package/lib/apphosting/utils.js +0 -26
  8. package/lib/auth.js +8 -2
  9. package/lib/commands/appcheck-debugtokens-create.js +60 -35
  10. package/lib/commands/appcheck-debugtokens-delete.js +21 -7
  11. package/lib/commands/appcheck-debugtokens-list.js +37 -8
  12. package/lib/commands/appcheck-debugtokens-prune.js +59 -0
  13. package/lib/commands/crashlytics-heapdumps-status.js +1 -1
  14. package/lib/commands/{crashlytics-onboard-web.js → crashlytics-setup.js} +5 -5
  15. package/lib/commands/crashlytics-sourcemap-upload.js +4 -0
  16. package/lib/commands/deploy.js +1 -3
  17. package/lib/commands/emulators-start.js +2 -2
  18. package/lib/commands/hosting-channel-create.js +1 -3
  19. package/lib/commands/hosting-channel-delete.js +1 -3
  20. package/lib/commands/hosting-channel-deploy.js +1 -3
  21. package/lib/commands/hosting-channel-list.js +1 -3
  22. package/lib/commands/hosting-channel-open.js +1 -3
  23. package/lib/commands/hosting-clone.js +3 -5
  24. package/lib/commands/hosting-disable.js +2 -2
  25. package/lib/commands/hosting-sites-create.js +1 -3
  26. package/lib/commands/hosting-sites-delete.js +1 -3
  27. package/lib/commands/hosting-sites-get.js +1 -3
  28. package/lib/commands/hosting-sites-list.js +1 -3
  29. package/lib/commands/index.js +4 -2
  30. package/lib/commands/run-services-get.js +19 -0
  31. package/lib/commands/run-services-list.js +11 -0
  32. package/lib/crashlytics/alerts.js +1 -0
  33. package/lib/crashlytics/events.js +122 -1
  34. package/lib/crashlytics/filters.js +12 -6
  35. package/lib/crashlytics/firebasetelemetry.js +5 -3
  36. package/lib/crashlytics/onboarding.js +8 -7
  37. package/lib/crashlytics/profilingManager.js +14 -34
  38. package/lib/crashlytics/reports.js +46 -17
  39. package/lib/crashlytics/sourcemap.js +19 -5
  40. package/lib/crashlytics/utils.js +14 -0
  41. package/lib/database/import.js +5 -4
  42. package/lib/dataconnect/dataplaneClient.js +0 -10
  43. package/lib/dataconnect/names.js +3 -3
  44. package/lib/dataconnect/schemaMigration.js +1 -1
  45. package/lib/deploy/apphosting/deploy.js +20 -41
  46. package/lib/deploy/apphosting/localBuild.js +49 -0
  47. package/lib/deploy/apphosting/prepare.js +12 -25
  48. package/lib/deploy/apphosting/release.js +1 -1
  49. package/lib/deploy/apphosting/util.js +27 -4
  50. package/lib/deploy/functions/backend.js +0 -10
  51. package/lib/deploy/functions/cel.js +1 -1
  52. package/lib/deploy/functions/containerCleaner.js +1 -142
  53. package/lib/deploy/functions/functionsDeployHelper.js +0 -4
  54. package/lib/deploy/functions/release/reporter.js +0 -26
  55. package/lib/deploy/functions/runtimes/discovery/index.js +4 -1
  56. package/lib/deploy/functions/runtimes/discovery/v1alpha1.js +1 -1
  57. package/lib/deploy/functions/services/index.js +13 -11
  58. package/lib/deploy/functions/validate.js +1 -1
  59. package/lib/deploy/hosting/prepare.js +1 -3
  60. package/lib/deploy/lifecycleHooks.js +1 -1
  61. package/lib/deploy/run/deploy.js +26 -43
  62. package/lib/deploy/run/get.js +30 -0
  63. package/lib/deploy/run/list.js +38 -0
  64. package/lib/deploy/run/prereqs.js +0 -3
  65. package/lib/deploy/run/util.js +9 -0
  66. package/lib/emulator/auth/operations.js +2 -2
  67. package/lib/emulator/auth/server.js +4 -2
  68. package/lib/emulator/auth/widget_ui.js +1 -1
  69. package/lib/emulator/commandUtils.js +109 -24
  70. package/lib/emulator/databaseEmulator.js +16 -11
  71. package/lib/emulator/dataconnect/pgliteServer.js +31 -24
  72. package/lib/emulator/downloadableEmulatorInfo.json +24 -24
  73. package/lib/emulator/downloadableEmulators.js +45 -7
  74. package/lib/emulator/extensions/postinstall.js +6 -6
  75. package/lib/emulator/firestoreEmulator.js +21 -15
  76. package/lib/emulator/functionsEmulator.js +11 -7
  77. package/lib/emulator/functionsEmulatorRuntime.js +7 -2
  78. package/lib/emulator/hub.js +12 -8
  79. package/lib/emulator/shared/express.js +30 -0
  80. package/lib/emulator/storage/apis/firebase.js +11 -10
  81. package/lib/emulator/storage/apis/gcloud.js +21 -20
  82. package/lib/emulator/storage/files.js +1 -1
  83. package/lib/emulator/storage/rules/manager.js +15 -12
  84. package/lib/emulator/storage/rules/runtime.js +1 -0
  85. package/lib/emulator/storage/server.js +10 -5
  86. package/lib/extensions/extensionsApi.js +0 -8
  87. package/lib/extensions/extensionsHelper.js +3 -24
  88. package/lib/extensions/paramHelper.js +1 -1
  89. package/lib/extensions/provisioningHelper.js +1 -6
  90. package/lib/extensions/secretsUtils.js +0 -24
  91. package/lib/firestore/util.js +3 -3
  92. package/lib/frameworks/angular/utils.js +1 -1
  93. package/lib/frameworks/next/utils.js +1 -12
  94. package/lib/fsAsync.js +34 -20
  95. package/lib/functions/kits/install.js +233 -628
  96. package/lib/functions/kits/sources/directory.js +91 -0
  97. package/lib/functions/kits/sources/npm.js +324 -0
  98. package/lib/functions/kits/sources/types.js +12 -0
  99. package/lib/functionsConfig.js +0 -4
  100. package/lib/functionsShellCommandAction.js +1 -1
  101. package/lib/gcp/artifactregistry.js +0 -5
  102. package/lib/gcp/cloudfunctionsv2.js +0 -6
  103. package/lib/gcp/devConnect.js +2 -2
  104. package/lib/gcp/iam.js +0 -4
  105. package/lib/gcp/pubsub.js +0 -14
  106. package/lib/gcp/storage.js +2 -1
  107. package/lib/hosting/api.js +79 -0
  108. package/lib/hosting/proxy.js +4 -1
  109. package/lib/init/features/hosting/github.js +6 -4
  110. package/lib/init/features/hosting/index.js +4 -0
  111. package/lib/init/features/run.js +3 -7
  112. package/lib/mcp/apps/init/mcp-app.js +4 -1
  113. package/lib/mcp/index.js +8 -2
  114. package/lib/mcp/prompts/apptesting/run_test.js +3 -3
  115. package/lib/mcp/prompts/core/deploy.js +3 -3
  116. package/lib/mcp/resources/guides/crashlytics_reports.js +33 -71
  117. package/lib/mcp/resources/guides/init_ai.js +10 -10
  118. package/lib/mcp/tools/crashlytics/events.js +18 -93
  119. package/lib/mcp/tools/crashlytics/index.js +2 -0
  120. package/lib/mcp/tools/crashlytics/reports.js +26 -31
  121. package/lib/mcp/tools/crashlytics/setup.js +392 -0
  122. package/lib/tsconfig.compile.tsbuildinfo +1 -1
  123. package/lib/tsconfig.publish.tsbuildinfo +1 -1
  124. package/lib/utils.js +4 -10
  125. package/package.json +1 -2
  126. package/lib/deploy/hosting/args.js +0 -2
@@ -8,9 +8,7 @@ exports.isRewriteSupportedByHosting = isRewriteSupportedByHosting;
8
8
  exports.isRedirectSupportedByHosting = isRedirectSupportedByHosting;
9
9
  exports.isHeaderSupportedByHosting = isHeaderSupportedByHosting;
10
10
  exports.getNextjsRewritesToUse = getNextjsRewritesToUse;
11
- exports.usesAppDirRouter = usesAppDirRouter;
12
11
  exports.usesNextImage = usesNextImage;
13
- exports.hasUnoptimizedImage = hasUnoptimizedImage;
14
12
  exports.isUsingMiddleware = isUsingMiddleware;
15
13
  exports.isUsingImageOptimization = isUsingImageOptimization;
16
14
  exports.isUsingNextImageInAppDirectory = isUsingNextImageInAppDirectory;
@@ -34,7 +32,6 @@ exports.findEsbuildPath = findEsbuildPath;
34
32
  exports.getGlobalEsbuildVersion = getGlobalEsbuildVersion;
35
33
  exports.installEsbuild = installEsbuild;
36
34
  exports.isNextJsVersionVulnerable = isNextJsVersionVulnerable;
37
- const fs_1 = require("fs");
38
35
  const fs_extra_1 = require("fs-extra");
39
36
  const path_1 = require("path");
40
37
  const promises_1 = require("fs/promises");
@@ -49,7 +46,7 @@ const streamJson_1 = require("../../streamJson");
49
46
  const constants_2 = require("../constants");
50
47
  const child_process_1 = require("child_process");
51
48
  const error_1 = require("../../error");
52
- exports.I18N_SOURCE = /\/:nextInternalLocale(\([^\)]+\))?/;
49
+ exports.I18N_SOURCE = /\/:nextInternalLocale(\([^)]+\))?/;
53
50
  function cleanEscapedChars(path) {
54
51
  return path.replace(/\\([(){}:+?*])/g, (a, b) => b);
55
52
  }
@@ -92,18 +89,10 @@ function getNextjsRewritesToUse(nextJsRewrites) {
92
89
  }
93
90
  return [];
94
91
  }
95
- function usesAppDirRouter(sourceDir) {
96
- const appPathRoutesManifestPath = (0, path_1.join)(sourceDir, constants_1.APP_PATH_ROUTES_MANIFEST);
97
- return (0, fs_1.existsSync)(appPathRoutesManifestPath);
98
- }
99
92
  async function usesNextImage(sourceDir, distDir) {
100
93
  const exportMarker = await (0, utils_1.readJSON)((0, path_1.join)(sourceDir, distDir, constants_1.EXPORT_MARKER));
101
94
  return exportMarker.isNextImageImported;
102
95
  }
103
- async function hasUnoptimizedImage(sourceDir, distDir) {
104
- const imagesManifest = await (0, utils_1.readJSON)((0, path_1.join)(sourceDir, distDir, constants_1.IMAGES_MANIFEST));
105
- return imagesManifest.images.unoptimized;
106
- }
107
96
  async function isUsingMiddleware(dir, isDevMode) {
108
97
  if (isDevMode) {
109
98
  const middlewareFiles = await Promise.all([
package/lib/fsAsync.js CHANGED
@@ -6,31 +6,42 @@ const ignore_1 = require("ignore");
6
6
  const _ = require("lodash");
7
7
  const minimatch = require("minimatch");
8
8
  const path_1 = require("path");
9
- const logger_1 = require("./logger");
9
+ const error_1 = require("./error");
10
+ function readGitIgnore(dirPath) {
11
+ const gitIgnorePath = (0, path_1.join)(dirPath, ".gitignore");
12
+ try {
13
+ const lines = (0, fs_extra_1.readFileSync)(gitIgnorePath)
14
+ .toString()
15
+ .split("\n")
16
+ .map((line) => line.trim())
17
+ .filter((line) => !line.startsWith("#") && line !== "");
18
+ return { dirPath, ignore: (0, ignore_1.default)().add(lines) };
19
+ }
20
+ catch (err) {
21
+ throw new error_1.FirebaseError(`Could not read ${gitIgnorePath}: ${(0, error_1.getErrMsg)(err)}`, {
22
+ original: (0, error_1.getError)(err),
23
+ });
24
+ }
25
+ }
26
+ function parentGitIgnores(root, dir) {
27
+ const folders = (0, path_1.relative)(root, dir).split(path_1.sep).filter(Boolean);
28
+ const states = [];
29
+ for (let depth = 0; depth < folders.length; depth++) {
30
+ const ancestor = (0, path_1.join)(root, ...folders.slice(0, depth));
31
+ const gitIgnorePath = (0, path_1.join)(ancestor, ".gitignore");
32
+ if (!(0, fs_extra_1.existsSync)(gitIgnorePath) || !(0, fs_extra_1.statSync)(gitIgnorePath).isFile()) {
33
+ continue;
34
+ }
35
+ states.push(readGitIgnore(ancestor));
36
+ }
37
+ return states;
38
+ }
10
39
  async function readdirRecursiveHelper(options) {
11
40
  const dirContents = (0, fs_extra_1.readdirSync)(options.path, { withFileTypes: true });
12
41
  let currentGitIgnoreStack = options.gitIgnoreStack || [];
13
42
  if (options.supportGitIgnore) {
14
43
  if (dirContents.find((n) => n.name === ".gitignore")?.isFile()) {
15
- const localGitIgnore = (0, path_1.join)(options.path, ".gitignore");
16
- try {
17
- const lines = (0, fs_extra_1.readFileSync)(localGitIgnore)
18
- .toString()
19
- .split("\n")
20
- .map((line) => line.trim())
21
- .filter((line) => !line.startsWith("#") && line !== "");
22
- const subIgnore = (0, ignore_1.default)().add(lines);
23
- currentGitIgnoreStack = [
24
- ...currentGitIgnoreStack,
25
- {
26
- dirPath: options.path,
27
- ignore: subIgnore,
28
- },
29
- ];
30
- }
31
- catch (e) {
32
- logger_1.logger.debug(`Error reading .gitignore file at ${localGitIgnore}:`, e);
33
- }
44
+ currentGitIgnoreStack = [...currentGitIgnoreStack, readGitIgnore(options.path)];
34
45
  }
35
46
  }
36
47
  const fullPaths = dirContents
@@ -91,6 +102,9 @@ async function readdirRecursive(options) {
91
102
  dirPath: options.path,
92
103
  ignore: (0, ignore_1.default)().add(options.ignoreStrings || []),
93
104
  });
105
+ if (options.gitIgnoreRoot) {
106
+ initialGitIgnoreStack.push(...parentGitIgnores(options.gitIgnoreRoot, options.path));
107
+ }
94
108
  }
95
109
  const maxDepth = options.maxDepth && options.maxDepth > 0 ? options.maxDepth : Infinity;
96
110
  return await readdirRecursiveHelper({