firebase-tools 10.0.0 → 10.1.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.
Files changed (244) hide show
  1. package/lib/accountExporter.js +9 -8
  2. package/lib/accountImporter.js +10 -8
  3. package/lib/api.js +1 -0
  4. package/lib/apiv2.js +2 -2
  5. package/lib/appdistribution/client.js +1 -1
  6. package/lib/appdistribution/options-parser-util.js +1 -1
  7. package/lib/auth.js +2 -2
  8. package/lib/bin/firebase.js +1 -1
  9. package/lib/command.js +26 -26
  10. package/lib/commands/appdistribution-distribute.js +4 -4
  11. package/lib/commands/appdistribution-testers-add.js +2 -2
  12. package/lib/commands/appdistribution-testers-remove.js +2 -2
  13. package/lib/commands/apps-android-sha-create.js +2 -2
  14. package/lib/commands/apps-android-sha-delete.js +2 -2
  15. package/lib/commands/apps-android-sha-list.js +2 -2
  16. package/lib/commands/apps-create.js +9 -9
  17. package/lib/commands/apps-list.js +3 -3
  18. package/lib/commands/apps-sdkconfig.js +8 -8
  19. package/lib/commands/auth-export.js +26 -25
  20. package/lib/commands/auth-import.js +88 -78
  21. package/lib/commands/database-get.js +1 -1
  22. package/lib/commands/database-instances-create.js +4 -4
  23. package/lib/commands/database-instances-list.js +4 -4
  24. package/lib/commands/database-profile.js +1 -1
  25. package/lib/commands/database-push.js +1 -1
  26. package/lib/commands/database-remove.js +2 -2
  27. package/lib/commands/database-set.js +2 -2
  28. package/lib/commands/database-settings-get.js +1 -1
  29. package/lib/commands/database-settings-set.js +1 -1
  30. package/lib/commands/database-update.js +2 -2
  31. package/lib/commands/ext-configure.js +3 -3
  32. package/lib/commands/ext-dev-deprecate.js +4 -4
  33. package/lib/commands/ext-dev-extension-delete.js +3 -3
  34. package/lib/commands/ext-dev-init.js +4 -4
  35. package/lib/commands/ext-dev-list.js +1 -1
  36. package/lib/commands/ext-dev-publish.js +4 -4
  37. package/lib/commands/ext-dev-register.js +6 -6
  38. package/lib/commands/ext-dev-undeprecate.js +4 -4
  39. package/lib/commands/ext-dev-unpublish.js +3 -3
  40. package/lib/commands/ext-dev-usage.js +145 -0
  41. package/lib/commands/ext-export.js +8 -8
  42. package/lib/commands/ext-info.js +5 -5
  43. package/lib/commands/ext-install.js +27 -23
  44. package/lib/commands/ext-list.js +2 -2
  45. package/lib/commands/ext-sources-create.js +2 -2
  46. package/lib/commands/ext-uninstall.js +4 -4
  47. package/lib/commands/ext-update.js +18 -18
  48. package/lib/commands/ext.js +3 -3
  49. package/lib/commands/firestore-delete.js +1 -1
  50. package/lib/commands/functions-config-clone.js +22 -23
  51. package/lib/commands/functions-config-export.js +11 -11
  52. package/lib/commands/functions-config-get.js +22 -22
  53. package/lib/commands/functions-config-set.js +24 -22
  54. package/lib/commands/functions-config-unset.js +20 -22
  55. package/lib/commands/functions-delete.js +3 -3
  56. package/lib/commands/functions-deletegcfartifacts.js +4 -4
  57. package/lib/commands/functions-list.js +1 -1
  58. package/lib/commands/functions-log.js +1 -1
  59. package/lib/commands/help.js +12 -12
  60. package/lib/commands/hosting-channel-create.js +13 -13
  61. package/lib/commands/hosting-channel-delete.js +10 -10
  62. package/lib/commands/hosting-channel-deploy.js +18 -18
  63. package/lib/commands/hosting-channel-list.js +5 -5
  64. package/lib/commands/hosting-channel-open.js +9 -9
  65. package/lib/commands/hosting-clone.js +16 -16
  66. package/lib/commands/hosting-disable.js +1 -1
  67. package/lib/commands/hosting-sites-create.js +7 -7
  68. package/lib/commands/hosting-sites-delete.js +7 -7
  69. package/lib/commands/hosting-sites-get.js +2 -2
  70. package/lib/commands/hosting-sites-list.js +3 -3
  71. package/lib/commands/index.js +1 -0
  72. package/lib/commands/login-ci.js +10 -10
  73. package/lib/commands/login.js +2 -2
  74. package/lib/commands/logout.js +1 -1
  75. package/lib/commands/open.js +1 -1
  76. package/lib/commands/projects-addfirebase.js +2 -2
  77. package/lib/commands/projects-create.js +2 -2
  78. package/lib/commands/projects-list.js +1 -1
  79. package/lib/commands/remoteconfig-get.js +3 -3
  80. package/lib/commands/remoteconfig-rollback.js +3 -3
  81. package/lib/commands/remoteconfig-versions-list.js +7 -2
  82. package/lib/commands/setup-emulators-database.js +8 -7
  83. package/lib/commands/setup-emulators-firestore.js +8 -7
  84. package/lib/commands/setup-emulators-pubsub.js +5 -4
  85. package/lib/commands/setup-emulators-storage.js +4 -3
  86. package/lib/commands/setup-emulators-ui.js +8 -7
  87. package/lib/commands/target-apply.js +17 -16
  88. package/lib/commands/target-clear.js +11 -10
  89. package/lib/commands/target-remove.js +10 -9
  90. package/lib/commands/target.js +20 -20
  91. package/lib/config.js +6 -6
  92. package/lib/database/api.js +2 -2
  93. package/lib/defaultCredentials.js +3 -3
  94. package/lib/deploy/extensions/deploy.js +4 -4
  95. package/lib/deploy/extensions/deploymentSummary.js +5 -4
  96. package/lib/deploy/extensions/index.js +1 -0
  97. package/lib/deploy/extensions/params.js +1 -1
  98. package/lib/deploy/extensions/planner.js +3 -3
  99. package/lib/deploy/extensions/prepare.js +9 -9
  100. package/lib/deploy/extensions/release.js +1 -1
  101. package/lib/deploy/extensions/secrets.js +7 -7
  102. package/lib/deploy/extensions/validate.js +2 -2
  103. package/lib/deploy/functions/backend.js +6 -4
  104. package/lib/deploy/functions/checkIam.js +7 -7
  105. package/lib/deploy/functions/containerCleaner.js +3 -3
  106. package/lib/deploy/functions/deploy.js +4 -4
  107. package/lib/deploy/functions/ensureCloudBuildEnabled.js +3 -3
  108. package/lib/deploy/functions/index.js +1 -0
  109. package/lib/deploy/functions/prepare.js +27 -21
  110. package/lib/deploy/functions/prompts.js +5 -5
  111. package/lib/deploy/functions/release/executor.js +4 -1
  112. package/lib/deploy/functions/release/fabricator.js +5 -5
  113. package/lib/deploy/functions/release/index.js +2 -2
  114. package/lib/deploy/functions/release/planner.js +6 -6
  115. package/lib/deploy/functions/release/reporter.js +8 -4
  116. package/lib/deploy/functions/runtimes/discovery/index.js +2 -2
  117. package/lib/deploy/functions/runtimes/discovery/v1alpha1.js +14 -14
  118. package/lib/deploy/functions/runtimes/golang/index.js +11 -14
  119. package/lib/deploy/functions/runtimes/index.js +6 -10
  120. package/lib/deploy/functions/runtimes/node/index.js +6 -10
  121. package/lib/deploy/functions/runtimes/node/parseTriggers.js +3 -3
  122. package/lib/deploy/functions/runtimes/node/validate.js +2 -1
  123. package/lib/deploy/functions/services/storage.js +1 -1
  124. package/lib/deploy/functions/triggerRegionHelper.js +1 -1
  125. package/lib/deploy/functions/validate.js +4 -3
  126. package/lib/deploy/hosting/deploy.js +7 -7
  127. package/lib/deploy/hosting/uploader.js +1 -1
  128. package/lib/deploy/hosting/validate.js +3 -3
  129. package/lib/deploy/remoteconfig/prepare.js +3 -3
  130. package/lib/deploy/remoteconfig/release.js +3 -3
  131. package/lib/deploy/storage/deploy.js +1 -1
  132. package/lib/deploy/storage/release.js +2 -2
  133. package/lib/detectProjectRoot.js +5 -5
  134. package/lib/emulator/auth/apiSpec.js +13 -7
  135. package/lib/emulator/auth/handlers.js +3 -3
  136. package/lib/emulator/auth/index.js +1 -1
  137. package/lib/emulator/auth/operations.js +256 -248
  138. package/lib/emulator/auth/server.js +11 -8
  139. package/lib/emulator/auth/state.js +12 -12
  140. package/lib/emulator/commandUtils.js +5 -5
  141. package/lib/emulator/controller.js +16 -11
  142. package/lib/emulator/downloadableEmulators.js +10 -9
  143. package/lib/emulator/emulatorLogger.js +1 -1
  144. package/lib/emulator/functionsEmulator.js +107 -74
  145. package/lib/emulator/functionsEmulatorRuntime.js +36 -21
  146. package/lib/emulator/functionsEmulatorShell.js +3 -2
  147. package/lib/emulator/functionsRuntimeWorker.js +1 -1
  148. package/lib/emulator/hubExport.js +2 -2
  149. package/lib/emulator/storage/apis/firebase.js +2 -2
  150. package/lib/emulator/storage/apis/gcloud.js +2 -2
  151. package/lib/emulator/storage/cloudFunctions.js +1 -1
  152. package/lib/emulator/storage/files.js +14 -14
  153. package/lib/emulator/storage/index.js +2 -2
  154. package/lib/emulator/storage/metadata.js +7 -6
  155. package/lib/emulator/storage/rules/runtime.js +10 -9
  156. package/lib/emulator/storage/server.js +2 -2
  157. package/lib/ensureApiEnabled.js +7 -7
  158. package/lib/error.js +3 -3
  159. package/lib/extensions/askUserForConsent.js +3 -4
  160. package/lib/extensions/askUserForParam.js +11 -11
  161. package/lib/extensions/billingMigrationHelper.js +2 -2
  162. package/lib/extensions/changelog.js +4 -4
  163. package/lib/extensions/displayExtensionInfo.js +6 -6
  164. package/lib/extensions/emulator/optionsHelper.js +1 -1
  165. package/lib/extensions/emulator/specHelper.js +1 -1
  166. package/lib/extensions/emulator/triggerHelper.js +1 -1
  167. package/lib/extensions/export.js +6 -6
  168. package/lib/extensions/extensionsApi.js +69 -110
  169. package/lib/extensions/extensionsHelper.js +56 -43
  170. package/lib/extensions/listExtensions.js +1 -1
  171. package/lib/extensions/localHelper.js +1 -1
  172. package/lib/extensions/metricsTypeDef.js +2 -0
  173. package/lib/extensions/metricsUtils.js +98 -0
  174. package/lib/extensions/paramHelper.js +6 -6
  175. package/lib/extensions/provisioningHelper.js +13 -14
  176. package/lib/extensions/resolveSource.js +6 -6
  177. package/lib/extensions/secretsUtils.js +3 -3
  178. package/lib/extensions/updateHelper.js +10 -10
  179. package/lib/extensions/utils.js +1 -1
  180. package/lib/extensions/warnings.js +11 -10
  181. package/lib/fetchWebSetup.js +2 -2
  182. package/lib/filterTargets.js +2 -2
  183. package/lib/firestore/indexes.js +2 -2
  184. package/lib/fsAsync.js +3 -3
  185. package/lib/fsutils.js +2 -2
  186. package/lib/functional.js +2 -1
  187. package/lib/functions/env.js +1 -1
  188. package/lib/functions/runtimeConfigExport.js +4 -4
  189. package/lib/functionsConfig.js +7 -8
  190. package/lib/functionsShellCommandAction.js +4 -3
  191. package/lib/gcp/cloudmonitoring.js +74 -0
  192. package/lib/gcp/cloudscheduler.js +1 -1
  193. package/lib/gcp/iam.js +2 -2
  194. package/lib/gcp/resourceManager.js +2 -2
  195. package/lib/gcp/rules.js +18 -41
  196. package/lib/gcp/secretManager.js +3 -2
  197. package/lib/getDefaultDatabaseInstance.js +1 -1
  198. package/lib/getDefaultHostingSite.js +1 -1
  199. package/lib/getProjectNumber.js +2 -2
  200. package/lib/handlePreviewToggles.js +5 -5
  201. package/lib/hosting/api.js +6 -6
  202. package/lib/hosting/cloudRunProxy.js +6 -6
  203. package/lib/hosting/functionsProxy.js +3 -3
  204. package/lib/hosting/implicitInit.js +2 -2
  205. package/lib/hosting/normalizedHostingConfigs.js +3 -3
  206. package/lib/hosting/proxy.js +2 -2
  207. package/lib/init/features/account.js +7 -7
  208. package/lib/init/features/database.js +9 -9
  209. package/lib/init/features/emulators.js +8 -8
  210. package/lib/init/features/firestore/index.js +3 -3
  211. package/lib/init/features/firestore/indexes.js +2 -2
  212. package/lib/init/features/firestore/rules.js +2 -2
  213. package/lib/init/features/functions/golang.js +4 -4
  214. package/lib/init/features/functions/index.js +4 -4
  215. package/lib/init/features/hosting/github.js +31 -31
  216. package/lib/init/features/project.js +8 -8
  217. package/lib/init/features/remoteconfig.js +2 -2
  218. package/lib/init/features/storage.js +2 -2
  219. package/lib/listFiles.js +1 -1
  220. package/lib/management/apps.js +3 -3
  221. package/lib/management/projects.js +6 -6
  222. package/lib/previews.js +2 -2
  223. package/lib/profiler.js +1 -1
  224. package/lib/projectPath.js +1 -1
  225. package/lib/projectUtils.js +2 -2
  226. package/lib/prompt.js +0 -1
  227. package/lib/rc.js +1 -1
  228. package/lib/remoteconfig/get.js +14 -8
  229. package/lib/remoteconfig/rollback.js +13 -6
  230. package/lib/remoteconfig/versionslist.js +13 -7
  231. package/lib/requireAuth.js +2 -2
  232. package/lib/requireDatabaseInstance.js +1 -1
  233. package/lib/requireHostingSite.js +1 -1
  234. package/lib/requirePermissions.js +4 -4
  235. package/lib/rulesDeploy.js +2 -2
  236. package/lib/serve/functions.js +14 -7
  237. package/lib/serve/hosting.js +7 -7
  238. package/lib/utils.js +3 -2
  239. package/npm-shrinkwrap.json +24095 -0
  240. package/package.json +33 -30
  241. package/templates/init/hosting/index.html +1 -1
  242. package/CHANGELOG.md +0 -5
  243. package/lib/commands/functions-config-legacy.js +0 -45
  244. package/lib/prepareFirebaseRules.js +0 -58
@@ -17,7 +17,7 @@ async function doSetup(setup, config) {
17
17
  };
18
18
  });
19
19
  const selections = {};
20
- await prompt_1.prompt(selections, [
20
+ await (0, prompt_1.prompt)(selections, [
21
21
  {
22
22
  type: "checkbox",
23
23
  name: "emulators",
@@ -37,7 +37,7 @@ async function doSetup(setup, config) {
37
37
  utils.logBullet(`Port for ${selected} already configured: ${clc.cyan(currentPort)}`);
38
38
  }
39
39
  else {
40
- await prompt_1.prompt(setup.config.emulators[selected], [
40
+ await (0, prompt_1.prompt)(setup.config.emulators[selected], [
41
41
  {
42
42
  type: "number",
43
43
  name: "port",
@@ -56,7 +56,7 @@ async function doSetup(setup, config) {
56
56
  else {
57
57
  const ui = setup.config.emulators.ui || {};
58
58
  setup.config.emulators.ui = ui;
59
- await prompt_1.prompt(ui, [
59
+ await (0, prompt_1.prompt)(ui, [
60
60
  {
61
61
  name: "enabled",
62
62
  type: "confirm",
@@ -65,7 +65,7 @@ async function doSetup(setup, config) {
65
65
  },
66
66
  ]);
67
67
  if (ui.enabled) {
68
- await prompt_1.prompt(ui, [
68
+ await (0, prompt_1.prompt)(ui, [
69
69
  {
70
70
  type: "input",
71
71
  name: "port",
@@ -76,7 +76,7 @@ async function doSetup(setup, config) {
76
76
  ui.port = isNaN(portNum) ? undefined : portNum;
77
77
  }
78
78
  }
79
- await prompt_1.prompt(selections, [
79
+ await (0, prompt_1.prompt)(selections, [
80
80
  {
81
81
  name: "download",
82
82
  type: "confirm",
@@ -87,12 +87,12 @@ async function doSetup(setup, config) {
87
87
  }
88
88
  if (selections.download) {
89
89
  for (const selected of selections.emulators) {
90
- if (types_1.isDownloadableEmulator(selected)) {
91
- await downloadableEmulators_1.downloadIfNecessary(selected);
90
+ if ((0, types_1.isDownloadableEmulator)(selected)) {
91
+ await (0, downloadableEmulators_1.downloadIfNecessary)(selected);
92
92
  }
93
93
  }
94
94
  if (_.get(setup, "config.emulators.ui.enabled")) {
95
- downloadableEmulators_1.downloadIfNecessary(types_1.Emulators.UI);
95
+ (0, downloadableEmulators_1.downloadIfNecessary)(types_1.Emulators.UI);
96
96
  }
97
97
  }
98
98
  }
@@ -16,7 +16,7 @@ async function checkProjectSetup(setup, config, options) {
16
16
  if (!isFirestoreEnabled) {
17
17
  throw firestoreUnusedError;
18
18
  }
19
- const dbType = await checkDatabaseType_1.checkDatabaseType(setup.projectId);
19
+ const dbType = await (0, checkDatabaseType_1.checkDatabaseType)(setup.projectId);
20
20
  logger_1.logger.debug(`database_type: ${dbType}`);
21
21
  if (!dbType) {
22
22
  throw firestoreUnusedError;
@@ -24,8 +24,8 @@ async function checkProjectSetup(setup, config, options) {
24
24
  else if (dbType !== "CLOUD_FIRESTORE") {
25
25
  throw new error_1.FirebaseError(`It looks like this project is using Cloud Datastore or Cloud Firestore in Datastore mode. The Firebase CLI can only manage projects using Cloud Firestore in Native mode. For more information, visit https://cloud.google.com/datastore/docs/firestore-or-datastore`, { exit: 1 });
26
26
  }
27
- ensureCloudResourceLocation_1.ensureLocationSet(setup.projectLocation, "Cloud Firestore");
28
- await requirePermissions_1.requirePermissions(Object.assign(Object.assign({}, options), { project: setup.projectId }));
27
+ (0, ensureCloudResourceLocation_1.ensureLocationSet)(setup.projectLocation, "Cloud Firestore");
28
+ await (0, requirePermissions_1.requirePermissions)(Object.assign(Object.assign({}, options), { project: setup.projectId }));
29
29
  }
30
30
  async function doSetup(setup, config, options) {
31
31
  if (setup.projectId) {
@@ -17,7 +17,7 @@ function initIndexes(setup, config) {
17
17
  logger_1.logger.info("set. You can keep index definitions in your project directory");
18
18
  logger_1.logger.info("and publish them with " + clc.bold("firebase deploy") + ".");
19
19
  logger_1.logger.info();
20
- return prompt_1.prompt(setup.config.firestore, [
20
+ return (0, prompt_1.prompt)(setup.config.firestore, [
21
21
  {
22
22
  type: "input",
23
23
  name: "indexes",
@@ -32,7 +32,7 @@ function initIndexes(setup, config) {
32
32
  clc.bold(filename) +
33
33
  " already exists." +
34
34
  " Do you want to overwrite it with the Firestore Indexes from the Firebase Console?";
35
- return prompt_1.promptOnce({
35
+ return (0, prompt_1.promptOnce)({
36
36
  type: "confirm",
37
37
  message: msg,
38
38
  default: false,
@@ -16,7 +16,7 @@ function initRules(setup, config) {
16
16
  logger_1.logger.info("requests. You can keep these rules in your project directory");
17
17
  logger_1.logger.info("and publish them with " + clc.bold("firebase deploy") + ".");
18
18
  logger_1.logger.info();
19
- return prompt_1.prompt(setup.config.firestore, [
19
+ return (0, prompt_1.prompt)(setup.config.firestore, [
20
20
  {
21
21
  type: "input",
22
22
  name: "rules",
@@ -31,7 +31,7 @@ function initRules(setup, config) {
31
31
  clc.bold(filename) +
32
32
  " already exists." +
33
33
  " Do you want to overwrite it with the Firestore Rules from the Firebase Console?";
34
- return prompt_1.promptOnce({
34
+ return (0, prompt_1.promptOnce)({
35
35
  type: "confirm",
36
36
  message: msg,
37
37
  default: false,
@@ -23,8 +23,8 @@ async function init(setup, config) {
23
23
  }
24
24
  async function writeModFile(config) {
25
25
  const modPath = config.path("functions/go.mod");
26
- if (await util_1.promisify(fs.exists)(modPath)) {
27
- const shoudlWriteModFile = await prompt_1.promptOnce({
26
+ if (await (0, util_1.promisify)(fs.exists)(modPath)) {
27
+ const shoudlWriteModFile = await (0, prompt_1.promptOnce)({
28
28
  type: "confirm",
29
29
  message: "File " + clc.underline("functions/go.mod") + " already exists. Overwrite?",
30
30
  default: false,
@@ -32,9 +32,9 @@ async function writeModFile(config) {
32
32
  if (!shoudlWriteModFile) {
33
33
  return;
34
34
  }
35
- await util_1.promisify(fs.unlink)(modPath);
35
+ await (0, util_1.promisify)(fs.unlink)(modPath);
36
36
  }
37
- const modName = await prompt_1.promptOnce({
37
+ const modName = await (0, prompt_1.promptOnce)({
38
38
  type: "input",
39
39
  message: "What would you like to name your module?",
40
40
  default: "acme.com/functions",
@@ -15,10 +15,10 @@ module.exports = async function (setup, config, options) {
15
15
  setup.functions = {};
16
16
  const projectId = (_b = (_a = setup === null || setup === void 0 ? void 0 : setup.rcfile) === null || _a === void 0 ? void 0 : _a.projects) === null || _b === void 0 ? void 0 : _b.default;
17
17
  if (projectId) {
18
- await requirePermissions_1.requirePermissions(Object.assign(Object.assign({}, options), { project: projectId }));
18
+ await (0, requirePermissions_1.requirePermissions)(Object.assign(Object.assign({}, options), { project: projectId }));
19
19
  await Promise.all([
20
- ensureApiEnabled_1.ensure(projectId, "cloudfunctions.googleapis.com", "unused", true),
21
- ensureApiEnabled_1.ensure(projectId, "runtimeconfig.googleapis.com", "unused", true),
20
+ (0, ensureApiEnabled_1.ensure)(projectId, "cloudfunctions.googleapis.com", "unused", true),
21
+ (0, ensureApiEnabled_1.ensure)(projectId, "runtimeconfig.googleapis.com", "unused", true),
22
22
  ]);
23
23
  }
24
24
  const choices = [
@@ -37,7 +37,7 @@ module.exports = async function (setup, config, options) {
37
37
  value: "golang",
38
38
  });
39
39
  }
40
- const language = await prompt_1.promptOnce({
40
+ const language = await (0, prompt_1.promptOnce)({
41
41
  type: "list",
42
42
  message: "What language would you like to use to write Cloud Functions?",
43
43
  default: "javascript",
@@ -29,10 +29,10 @@ const HOSTING_GITHUB_ACTION_NAME = "FirebaseExtended/action-hosting-deploy@v0";
29
29
  const githubApiClient = new apiv2_1.Client({ urlPrefix: api_1.githubApiOrigin, auth: false });
30
30
  async function initGitHub(setup, config, options) {
31
31
  if (!setup.projectId) {
32
- return utils_1.reject("Could not determine Project ID, can't set up GitHub workflow.", { exit: 1 });
32
+ return (0, utils_1.reject)("Could not determine Project ID, can't set up GitHub workflow.", { exit: 1 });
33
33
  }
34
34
  if (!setup.config.hosting) {
35
- return utils_1.reject(`Didn't find a Hosting config in firebase.json. Run ${cli_color_1.bold("firebase init hosting")} instead.`);
35
+ return (0, utils_1.reject)(`Didn't find a Hosting config in firebase.json. Run ${(0, cli_color_1.bold)("firebase init hosting")} instead.`);
36
36
  }
37
37
  logger_1.logger.info();
38
38
  const gitRoot = getGitFolderPath();
@@ -41,12 +41,12 @@ async function initGitHub(setup, config, options) {
41
41
  WORKFLOW_DIR = `${GITHUB_DIR}/workflows`;
42
42
  YML_FULL_PATH_PULL_REQUEST = `${WORKFLOW_DIR}/${YML_PULL_REQUEST_FILENAME}`;
43
43
  YML_FULL_PATH_MERGE = `${WORKFLOW_DIR}/${YML_MERGE_FILENAME}`;
44
- utils_1.logBullet("Authorizing with GitHub to upload your service account to a GitHub repository's secrets store.");
44
+ (0, utils_1.logBullet)("Authorizing with GitHub to upload your service account to a GitHub repository's secrets store.");
45
45
  const ghAccessToken = await signInWithGitHub();
46
46
  const userDetails = await getGitHubUserDetails(ghAccessToken);
47
47
  const ghUserName = userDetails.login;
48
48
  logger_1.logger.info();
49
- utils_1.logSuccess(`Success! Logged into GitHub as ${cli_color_1.bold(ghUserName)}`);
49
+ (0, utils_1.logSuccess)(`Success! Logged into GitHub as ${(0, cli_color_1.bold)(ghUserName)}`);
50
50
  logger_1.logger.info();
51
51
  const { repo, key, keyId } = await promptForRepo(setup, ghAccessToken);
52
52
  const { default_branch: defaultBranch, id: repoId } = await getRepoDetails(repo, ghAccessToken);
@@ -56,17 +56,17 @@ async function initGitHub(setup, config, options) {
56
56
  const serviceAccountName = `github-action-${repoId}`;
57
57
  const serviceAccountJSON = await createServiceAccountAndKeyWithRetry(setup, repo, serviceAccountName);
58
58
  logger_1.logger.info();
59
- utils_1.logSuccess(`Created service account ${cli_color_1.bold(serviceAccountName)} with Firebase Hosting admin permissions.`);
60
- const spinnerSecrets = ora.default(`Uploading service account secrets to repository: ${repo}`);
59
+ (0, utils_1.logSuccess)(`Created service account ${(0, cli_color_1.bold)(serviceAccountName)} with Firebase Hosting admin permissions.`);
60
+ const spinnerSecrets = ora(`Uploading service account secrets to repository: ${repo}`);
61
61
  spinnerSecrets.start();
62
62
  const encryptedServiceAccountJSON = encryptServiceAccountJSON(serviceAccountJSON, key);
63
63
  await uploadSecretToGitHub(repo, ghAccessToken, encryptedServiceAccountJSON, keyId, githubSecretName);
64
64
  spinnerSecrets.stop();
65
- utils_1.logSuccess(`Uploaded service account JSON to GitHub as secret ${cli_color_1.bold(githubSecretName)}.`);
66
- utils_1.logBullet(`You can manage your secrets at https://github.com/${repo}/settings/secrets.`);
65
+ (0, utils_1.logSuccess)(`Uploaded service account JSON to GitHub as secret ${(0, cli_color_1.bold)(githubSecretName)}.`);
66
+ (0, utils_1.logBullet)(`You can manage your secrets at https://github.com/${repo}/settings/secrets.`);
67
67
  logger_1.logger.info();
68
68
  if (setup.config.hosting.predeploy) {
69
- utils_1.logBullet(`You have a predeploy script configured in firebase.json.`);
69
+ (0, utils_1.logBullet)(`You have a predeploy script configured in firebase.json.`);
70
70
  }
71
71
  const { script } = await promptForBuildScript();
72
72
  const ymlDeployDoc = loadYMLDeploy();
@@ -81,7 +81,7 @@ async function initGitHub(setup, config, options) {
81
81
  if (shouldWriteYMLHostingFile) {
82
82
  writeChannelActionYMLFile(YML_FULL_PATH_PULL_REQUEST, githubSecretName, setup.projectId, script);
83
83
  logger_1.logger.info();
84
- utils_1.logSuccess(`Created workflow file ${cli_color_1.bold(YML_FULL_PATH_PULL_REQUEST)}`);
84
+ (0, utils_1.logSuccess)(`Created workflow file ${(0, cli_color_1.bold)(YML_FULL_PATH_PULL_REQUEST)}`);
85
85
  }
86
86
  const { setupDeploys, branch } = await promptToSetupDeploys(ymlDeployDoc.branch || defaultBranch);
87
87
  if (setupDeploys) {
@@ -102,13 +102,13 @@ async function initGitHub(setup, config, options) {
102
102
  if (shouldWriteYMLDeployFile) {
103
103
  writeDeployToProdActionYMLFile(YML_FULL_PATH_MERGE, branch, githubSecretName, setup.projectId, script);
104
104
  logger_1.logger.info();
105
- utils_1.logSuccess(`Created workflow file ${cli_color_1.bold(YML_FULL_PATH_MERGE)}`);
105
+ (0, utils_1.logSuccess)(`Created workflow file ${(0, cli_color_1.bold)(YML_FULL_PATH_MERGE)}`);
106
106
  }
107
107
  }
108
108
  logger_1.logger.info();
109
- utils_1.logLabeledBullet("Action required", `Visit this URL to revoke authorization for the Firebase CLI GitHub OAuth App:`);
109
+ (0, utils_1.logLabeledBullet)("Action required", `Visit this URL to revoke authorization for the Firebase CLI GitHub OAuth App:`);
110
110
  logger_1.logger.info(cli_color_1.bold.underline(`https://github.com/settings/connections/applications/${api_1.githubClientId}`));
111
- utils_1.logLabeledBullet("Action required", `Push any new workflow file(s) to your repo`);
111
+ (0, utils_1.logLabeledBullet)("Action required", `Push any new workflow file(s) to your repo`);
112
112
  }
113
113
  exports.initGitHub = initGitHub;
114
114
  function getGitFolderPath() {
@@ -117,12 +117,12 @@ function getGitFolderPath() {
117
117
  while (!fs.existsSync(path.resolve(projectRootDir, ".git"))) {
118
118
  const parentDir = path.dirname(projectRootDir);
119
119
  if (parentDir === projectRootDir) {
120
- utils_1.logBullet(`Didn't detect a .git folder. Assuming ${commandDir} is the project root.`);
120
+ (0, utils_1.logBullet)(`Didn't detect a .git folder. Assuming ${commandDir} is the project root.`);
121
121
  return commandDir;
122
122
  }
123
123
  projectRootDir = parentDir;
124
124
  }
125
- utils_1.logBullet(`Detected a .git folder at ${projectRootDir}`);
125
+ (0, utils_1.logBullet)(`Detected a .git folder at ${projectRootDir}`);
126
126
  return projectRootDir;
127
127
  }
128
128
  function defaultGithubRepo() {
@@ -147,10 +147,10 @@ function loadYMLDeploy() {
147
147
  }
148
148
  }
149
149
  function loadYML(ymlPath) {
150
- return js_yaml_1.safeLoad(fs.readFileSync(ymlPath, "utf8"));
150
+ return (0, js_yaml_1.safeLoad)(fs.readFileSync(ymlPath, "utf8"));
151
151
  }
152
152
  function mkdirNotExists(dir) {
153
- if (!fsutils_1.dirExistsSync(dir)) {
153
+ if (!(0, fsutils_1.dirExistsSync)(dir)) {
154
154
  fs.mkdirSync(dir);
155
155
  }
156
156
  }
@@ -231,7 +231,7 @@ async function uploadSecretToGitHub(repo, ghAccessToken, encryptedServiceAccount
231
231
  async function promptForRepo(options, ghAccessToken) {
232
232
  let key = "";
233
233
  let keyId = "";
234
- const { repo } = await prompt_1.prompt(options, [
234
+ const { repo } = await (0, prompt_1.prompt)(options, [
235
235
  {
236
236
  type: "input",
237
237
  name: "repo",
@@ -250,9 +250,9 @@ async function promptForRepo(options, ghAccessToken) {
250
250
  if (e.status === 403) {
251
251
  logger_1.logger.info();
252
252
  logger_1.logger.info();
253
- utils_1.logWarning("The provided authorization cannot be used with this repository. If this repository is in an organization, did you remember to grant access?", "error");
253
+ (0, utils_1.logWarning)("The provided authorization cannot be used with this repository. If this repository is in an organization, did you remember to grant access?", "error");
254
254
  logger_1.logger.info();
255
- utils_1.logLabeledBullet("Action required", `Visit this URL to ensure access has been granted to the appropriate organization(s) for the Firebase CLI GitHub OAuth App:`);
255
+ (0, utils_1.logLabeledBullet)("Action required", `Visit this URL to ensure access has been granted to the appropriate organization(s) for the Firebase CLI GitHub OAuth App:`);
256
256
  logger_1.logger.info(cli_color_1.bold.underline(`https://github.com/settings/connections/applications/${api_1.githubClientId}`));
257
257
  logger_1.logger.info();
258
258
  }
@@ -265,7 +265,7 @@ async function promptForRepo(options, ghAccessToken) {
265
265
  return { repo, key, keyId };
266
266
  }
267
267
  async function promptForBuildScript() {
268
- const { shouldSetupScript } = await prompt_1.prompt({}, [
268
+ const { shouldSetupScript } = await (0, prompt_1.prompt)({}, [
269
269
  {
270
270
  type: "confirm",
271
271
  name: "shouldSetupScript",
@@ -276,7 +276,7 @@ async function promptForBuildScript() {
276
276
  if (!shouldSetupScript) {
277
277
  return { script: undefined };
278
278
  }
279
- const { script } = await prompt_1.prompt({}, [
279
+ const { script } = await (0, prompt_1.prompt)({}, [
280
280
  {
281
281
  type: "input",
282
282
  name: "script",
@@ -287,7 +287,7 @@ async function promptForBuildScript() {
287
287
  return { script };
288
288
  }
289
289
  async function promptToSetupDeploys(defaultBranch) {
290
- const { setupDeploys } = await prompt_1.prompt({}, [
290
+ const { setupDeploys } = await (0, prompt_1.prompt)({}, [
291
291
  {
292
292
  type: "confirm",
293
293
  name: "setupDeploys",
@@ -298,7 +298,7 @@ async function promptToSetupDeploys(defaultBranch) {
298
298
  if (!setupDeploys) {
299
299
  return { setupDeploys };
300
300
  }
301
- const { branch } = await prompt_1.prompt({}, [
301
+ const { branch } = await (0, prompt_1.prompt)({}, [
302
302
  {
303
303
  type: "input",
304
304
  name: "branch",
@@ -309,7 +309,7 @@ async function promptToSetupDeploys(defaultBranch) {
309
309
  return { branch, setupDeploys };
310
310
  }
311
311
  async function promptForWriteYMLFile({ message }) {
312
- return await prompt_1.prompt({}, [
312
+ return await (0, prompt_1.prompt)({}, [
313
313
  {
314
314
  type: "confirm",
315
315
  name: "overwrite",
@@ -331,10 +331,10 @@ async function getRepoDetails(repo, ghAccessToken) {
331
331
  return body;
332
332
  }
333
333
  async function signInWithGitHub() {
334
- return await auth_1.loginGithub();
334
+ return await (0, auth_1.loginGithub)();
335
335
  }
336
336
  async function createServiceAccountAndKeyWithRetry(options, repo, accountId) {
337
- const spinnerServiceAccount = ora.default("Retrieving a service account.");
337
+ const spinnerServiceAccount = ora("Retrieving a service account.");
338
338
  spinnerServiceAccount.start();
339
339
  try {
340
340
  const serviceAccountJSON = await createServiceAccountAndKey(options, repo, accountId);
@@ -347,7 +347,7 @@ async function createServiceAccountAndKeyWithRetry(options, repo, accountId) {
347
347
  throw e;
348
348
  }
349
349
  spinnerServiceAccount.start();
350
- await iam_1.deleteServiceAccount(options.projectId, `${accountId}@${options.projectId}.iam.gserviceaccount.com`);
350
+ await (0, iam_1.deleteServiceAccount)(options.projectId, `${accountId}@${options.projectId}.iam.gserviceaccount.com`);
351
351
  const serviceAccountJSON = await createServiceAccountAndKey(options, repo, accountId);
352
352
  spinnerServiceAccount.stop();
353
353
  return serviceAccountJSON;
@@ -355,7 +355,7 @@ async function createServiceAccountAndKeyWithRetry(options, repo, accountId) {
355
355
  }
356
356
  async function createServiceAccountAndKey(options, repo, accountId) {
357
357
  try {
358
- await iam_1.createServiceAccount(options.projectId, accountId, `A service account with permission to deploy to Firebase Hosting for the GitHub repository ${repo}`, `GitHub Actions (${repo})`);
358
+ await (0, iam_1.createServiceAccount)(options.projectId, accountId, `A service account with permission to deploy to Firebase Hosting for the GitHub repository ${repo}`, `GitHub Actions (${repo})`);
359
359
  }
360
360
  catch (e) {
361
361
  if (!e.message.includes("409")) {
@@ -368,8 +368,8 @@ async function createServiceAccountAndKey(options, repo, accountId) {
368
368
  resourceManager_1.firebaseRoles.hostingAdmin,
369
369
  resourceManager_1.firebaseRoles.runViewer,
370
370
  ];
371
- await resourceManager_1.addServiceAccountToRoles(options.projectId, accountId, requiredRoles);
372
- const serviceAccountKey = await iam_1.createServiceAccountKey(options.projectId, accountId);
371
+ await (0, resourceManager_1.addServiceAccountToRoles)(options.projectId, accountId, requiredRoles);
372
+ const serviceAccountKey = await (0, iam_1.createServiceAccountKey)(options.projectId, accountId);
373
373
  const buf = Buffer.from(serviceAccountKey.privateKeyData, "base64");
374
374
  const serviceAccountJSON = buf.toString();
375
375
  return serviceAccountJSON;
@@ -25,20 +25,20 @@ async function promptAndCreateNewProject() {
25
25
  utils.logBullet("If you want to create a project in a Google Cloud organization or folder, please use " +
26
26
  `"firebase projects:create" instead, and return to this command when you've created the project.`);
27
27
  const promptAnswer = {};
28
- await prompt_1.prompt(promptAnswer, projects_1.PROJECTS_CREATE_QUESTIONS);
28
+ await (0, prompt_1.prompt)(promptAnswer, projects_1.PROJECTS_CREATE_QUESTIONS);
29
29
  if (!promptAnswer.projectId) {
30
30
  throw new error_1.FirebaseError("Project ID cannot be empty");
31
31
  }
32
- return await projects_1.createFirebaseProjectAndLog(promptAnswer.projectId, {
32
+ return await (0, projects_1.createFirebaseProjectAndLog)(promptAnswer.projectId, {
33
33
  displayName: promptAnswer.displayName,
34
34
  });
35
35
  }
36
36
  async function promptAndAddFirebaseToCloudProject() {
37
- const projectId = await projects_1.promptAvailableProjectId();
37
+ const projectId = await (0, projects_1.promptAvailableProjectId)();
38
38
  if (!projectId) {
39
39
  throw new error_1.FirebaseError("Project ID cannot be empty");
40
40
  }
41
- return await projects_1.addFirebaseToCloudProjectAndLog(projectId);
41
+ return await (0, projects_1.addFirebaseToCloudProjectAndLog)(projectId);
42
42
  }
43
43
  async function projectChoicePrompt(options) {
44
44
  const choices = [
@@ -47,7 +47,7 @@ async function projectChoicePrompt(options) {
47
47
  { name: OPTION_ADD_FIREBASE, value: OPTION_ADD_FIREBASE },
48
48
  { name: OPTION_NO_PROJECT, value: OPTION_NO_PROJECT },
49
49
  ];
50
- const projectSetupOption = await prompt_1.promptOnce({
50
+ const projectSetupOption = await (0, prompt_1.promptOnce)({
51
51
  type: "list",
52
52
  name: "id",
53
53
  message: "Please select an option:",
@@ -55,7 +55,7 @@ async function projectChoicePrompt(options) {
55
55
  });
56
56
  switch (projectSetupOption) {
57
57
  case OPTION_USE_PROJECT:
58
- return projects_1.getOrPromptProject(options);
58
+ return (0, projects_1.getOrPromptProject)(options);
59
59
  case OPTION_NEW_PROJECT:
60
60
  return promptAndCreateNewProject();
61
61
  case OPTION_ADD_FIREBASE:
@@ -74,7 +74,7 @@ async function doSetup(setup, config, options) {
74
74
  const projectFromRcFile = _.get(setup.rcfile, "projects.default");
75
75
  if (projectFromRcFile && !options.project) {
76
76
  utils.logBullet(`.firebaserc already has a default project, using ${projectFromRcFile}.`);
77
- const rcProject = await projects_1.getFirebaseProject(projectFromRcFile);
77
+ const rcProject = await (0, projects_1.getFirebaseProject)(projectFromRcFile);
78
78
  setup.projectId = rcProject.projectId;
79
79
  setup.projectLocation = _.get(rcProject, "resources.locationId");
80
80
  return;
@@ -82,7 +82,7 @@ async function doSetup(setup, config, options) {
82
82
  let projectMetaData;
83
83
  if (options.project) {
84
84
  logger_1.logger.debug(`Using project from CLI flag: ${options.project}`);
85
- projectMetaData = await projects_1.getFirebaseProject(options.project);
85
+ projectMetaData = await (0, projects_1.getFirebaseProject)(options.project);
86
86
  }
87
87
  else {
88
88
  projectMetaData = await projectChoicePrompt(options);
@@ -6,7 +6,7 @@ const fsutils = require("../../fsutils");
6
6
  const clc = require("cli-color");
7
7
  async function doSetup(setup, config) {
8
8
  setup.config.remoteconfig = {};
9
- const jsonFilePath = await prompt_1.promptOnce({
9
+ const jsonFilePath = await (0, prompt_1.promptOnce)({
10
10
  type: "input",
11
11
  name: "template",
12
12
  message: "What file should be used for your Remote Config template?",
@@ -17,7 +17,7 @@ async function doSetup(setup, config) {
17
17
  clc.bold(jsonFilePath) +
18
18
  " already exists." +
19
19
  " Do you want to overwrite the existing Remote Config template?";
20
- const overwrite = await prompt_1.promptOnce({
20
+ const overwrite = await (0, prompt_1.promptOnce)({
21
21
  type: "confirm",
22
22
  message: msg,
23
23
  default: false,
@@ -9,13 +9,13 @@ const ensureCloudResourceLocation_1 = require("../../ensureCloudResourceLocation
9
9
  const RULES_TEMPLATE = fs.readFileSync(__dirname + "/../../../templates/init/storage/storage.rules", "utf8");
10
10
  async function doSetup(setup, config) {
11
11
  setup.config.storage = {};
12
- ensureCloudResourceLocation_1.ensureLocationSet(setup.projectLocation, "Cloud Storage");
12
+ (0, ensureCloudResourceLocation_1.ensureLocationSet)(setup.projectLocation, "Cloud Storage");
13
13
  logger_1.logger.info();
14
14
  logger_1.logger.info("Firebase Storage Security Rules allow you to define how and when to allow");
15
15
  logger_1.logger.info("uploads and downloads. You can keep these rules in your project directory");
16
16
  logger_1.logger.info("and publish them with " + clc.bold("firebase deploy") + ".");
17
17
  logger_1.logger.info();
18
- const storageRulesFile = await prompt_1.promptOnce({
18
+ const storageRulesFile = await (0, prompt_1.promptOnce)({
19
19
  type: "input",
20
20
  name: "rules",
21
21
  message: "What file should be used for Storage Rules?",
package/lib/listFiles.js CHANGED
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.listFiles = void 0;
4
4
  const glob_1 = require("glob");
5
5
  function listFiles(cwd, ignore = []) {
6
- return glob_1.sync("**/*", {
6
+ return (0, glob_1.sync)("**/*", {
7
7
  cwd,
8
8
  dot: true,
9
9
  follow: true,
@@ -47,7 +47,7 @@ async function createIosApp(projectId, options) {
47
47
  timeout: CREATE_APP_API_REQUEST_TIMEOUT_MILLIS,
48
48
  data: options,
49
49
  });
50
- const appData = await operation_poller_1.pollOperation({
50
+ const appData = await (0, operation_poller_1.pollOperation)({
51
51
  pollerName: "Create iOS app Poller",
52
52
  apiOrigin: api.firebaseApiOrigin,
53
53
  apiVersion: "v1beta1",
@@ -69,7 +69,7 @@ async function createAndroidApp(projectId, options) {
69
69
  timeout: CREATE_APP_API_REQUEST_TIMEOUT_MILLIS,
70
70
  data: options,
71
71
  });
72
- const appData = await operation_poller_1.pollOperation({
72
+ const appData = await (0, operation_poller_1.pollOperation)({
73
73
  pollerName: "Create Android app Poller",
74
74
  apiOrigin: api.firebaseApiOrigin,
75
75
  apiVersion: "v1beta1",
@@ -94,7 +94,7 @@ async function createWebApp(projectId, options) {
94
94
  timeout: CREATE_APP_API_REQUEST_TIMEOUT_MILLIS,
95
95
  data: options,
96
96
  });
97
- const appData = await operation_poller_1.pollOperation({
97
+ const appData = await (0, operation_poller_1.pollOperation)({
98
98
  pollerName: "Create Web app Poller",
99
99
  apiOrigin: api.firebaseApiOrigin,
100
100
  apiVersion: "v1beta1",
@@ -103,7 +103,7 @@ async function selectProjectInteractively(pageSize = MAXIMUM_PROMPT_LIST) {
103
103
  return selectProjectFromList(projects);
104
104
  }
105
105
  async function selectProjectByPrompting() {
106
- const projectId = await prompt_1.promptOnce({
106
+ const projectId = await (0, prompt_1.promptOnce)({
107
107
  type: "input",
108
108
  message: "Please input the project ID you would like to use:",
109
109
  });
@@ -123,7 +123,7 @@ async function selectProjectFromList(projects = []) {
123
123
  utils.logBullet(`Don't want to scroll through all your projects? If you know your project ID, ` +
124
124
  `you can initialize it directly using ${clc.bold("firebase init --project <project_id>")}.\n`);
125
125
  }
126
- const projectId = await prompt_1.promptOnce({
126
+ const projectId = await (0, prompt_1.promptOnce)({
127
127
  type: "list",
128
128
  name: "id",
129
129
  message: "Select a default Firebase project for this directory:",
@@ -145,7 +145,7 @@ async function promptAvailableProjectId() {
145
145
  throw new error_1.FirebaseError("There are no available Google Cloud projects to add Firebase services.");
146
146
  }
147
147
  if (nextPageToken) {
148
- return await prompt_1.promptOnce({
148
+ return await (0, prompt_1.promptOnce)({
149
149
  type: "input",
150
150
  message: "Please input the ID of the Google Cloud Project you would like to add Firebase:",
151
151
  });
@@ -161,7 +161,7 @@ async function promptAvailableProjectId() {
161
161
  };
162
162
  });
163
163
  choices = _.orderBy(choices, ["name"], ["asc"]);
164
- return await prompt_1.promptOnce({
164
+ return await (0, prompt_1.promptOnce)({
165
165
  type: "list",
166
166
  name: "id",
167
167
  message: "Select the Google Cloud Platform project you would like to add Firebase:",
@@ -178,7 +178,7 @@ async function createCloudProject(projectId, options) {
178
178
  timeout: CREATE_PROJECT_API_REQUEST_TIMEOUT_MILLIS,
179
179
  data: { projectId, name: options.displayName || projectId, parent: options.parentResource },
180
180
  });
181
- const projectInfo = await operation_poller_1.pollOperation({
181
+ const projectInfo = await (0, operation_poller_1.pollOperation)({
182
182
  pollerName: "Project Creation Poller",
183
183
  apiOrigin: api.resourceManagerOrigin,
184
184
  apiVersion: "v1",
@@ -209,7 +209,7 @@ async function addFirebaseToCloudProject(projectId) {
209
209
  origin: api.firebaseApiOrigin,
210
210
  timeout: CREATE_PROJECT_API_REQUEST_TIMEOUT_MILLIS,
211
211
  });
212
- const projectInfo = await operation_poller_1.pollOperation({
212
+ const projectInfo = await (0, operation_poller_1.pollOperation)({
213
213
  pollerName: "Add Firebase Poller",
214
214
  apiOrigin: api.firebaseApiOrigin,
215
215
  apiVersion: "v1beta1",
package/lib/previews.js CHANGED
@@ -6,8 +6,8 @@ const configstore_1 = require("./configstore");
6
6
  exports.previews = Object.assign({ rtdbrules: false, ext: false, extdev: false, rtdbmanagement: false, functionsv2: false, golang: false, deletegcfartifacts: false, dotenv: false, artifactregistry: 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
- if (lodash_1.has(exports.previews, feature)) {
10
- lodash_1.set(exports.previews, feature, true);
9
+ if ((0, lodash_1.has)(exports.previews, feature)) {
10
+ (0, lodash_1.set)(exports.previews, feature, true);
11
11
  }
12
12
  });
13
13
  }
package/lib/profiler.js CHANGED
@@ -14,7 +14,7 @@ const responseToError = require("./responseToError");
14
14
  const utils = require("./utils");
15
15
  tmp.setGracefulCleanup();
16
16
  async function profiler(options) {
17
- const origin = api_1.realtimeOriginOrEmulatorOrCustomUrl(options.instanceDetails.databaseUrl);
17
+ const origin = (0, api_1.realtimeOriginOrEmulatorOrCustomUrl)(options.instanceDetails.databaseUrl);
18
18
  const url = new URL(utils.getDatabaseUrl(origin, options.instance, "/.settings/profile.json?"));
19
19
  const rl = readline.createInterface({ input: process.stdin });
20
20
  const fileOut = !!options.output;
@@ -5,7 +5,7 @@ const path = require("path");
5
5
  const detectProjectRoot_1 = require("./detectProjectRoot");
6
6
  const error_1 = require("./error");
7
7
  function resolveProjectPath(options, filePath) {
8
- const projectRoot = detectProjectRoot_1.detectProjectRoot(options);
8
+ const projectRoot = (0, detectProjectRoot_1.detectProjectRoot)(options);
9
9
  if (!projectRoot) {
10
10
  throw new error_1.FirebaseError("Expected to be in a project directory, but none was found.", {
11
11
  exit: 2,
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getAliases = exports.needProjectNumber = exports.needProjectId = exports.getProjectId = void 0;
4
4
  const projects_1 = require("./management/projects");
5
5
  const clc = require("cli-color");
6
- const marked = require("marked");
6
+ const { marked } = require("marked");
7
7
  const { FirebaseError } = require("./error");
8
8
  function getProjectId({ projectId, project, }) {
9
9
  return projectId || project;
@@ -43,7 +43,7 @@ async function needProjectNumber(options) {
43
43
  return options.projectNumber;
44
44
  }
45
45
  const projectId = needProjectId(options);
46
- const metadata = await projects_1.getFirebaseProject(projectId);
46
+ const metadata = await (0, projects_1.getFirebaseProject)(projectId);
47
47
  options.projectNumber = metadata.projectNumber;
48
48
  return options.projectNumber;
49
49
  }
package/lib/prompt.js CHANGED
@@ -15,7 +15,6 @@ async function prompt(options, questions) {
15
15
  const missingOptions = _.uniq(_.map(prompts, "name")).join(", ");
16
16
  throw new error_1.FirebaseError(`Missing required options (${missingOptions}) while running in non-interactive mode`, {
17
17
  children: prompts,
18
- exit: 1,
19
18
  });
20
19
  }
21
20
  const answers = await inquirer.prompt(prompts);
package/lib/rc.js CHANGED
@@ -17,7 +17,7 @@ const TARGET_TYPES = {
17
17
  };
18
18
  function loadRC(options) {
19
19
  const cwd = options.cwd || process.cwd();
20
- const dir = detectProjectRoot_1.detectProjectRoot(options);
20
+ const dir = (0, detectProjectRoot_1.detectProjectRoot)(options);
21
21
  const potential = path.resolve(dir || cwd, "./.firebaserc");
22
22
  return RC.loadFile(potential);
23
23
  }