firebase-tools 11.1.0 → 11.2.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 (88) hide show
  1. package/lib/accountExporter.js +11 -4
  2. package/lib/accountImporter.js +5 -6
  3. package/lib/appdistribution/client.js +7 -9
  4. package/lib/auth.js +3 -5
  5. package/lib/checkValidTargetFilters.js +28 -18
  6. package/lib/commands/database-profile.js +2 -3
  7. package/lib/commands/database-push.js +2 -3
  8. package/lib/commands/database-remove.js +1 -2
  9. package/lib/commands/database-set.js +1 -2
  10. package/lib/commands/deploy.js +5 -6
  11. package/lib/commands/ext-dev-emulators-exec.js +1 -1
  12. package/lib/commands/ext-dev-emulators-start.js +1 -1
  13. package/lib/commands/ext-dev-list.js +6 -7
  14. package/lib/commands/ext-info.js +12 -13
  15. package/lib/commands/ext.js +2 -3
  16. package/lib/commands/functions-delete.js +1 -7
  17. package/lib/commands/open.js +5 -6
  18. package/lib/commands/serve.js +3 -5
  19. package/lib/commands/use.js +2 -3
  20. package/lib/config.js +4 -3
  21. package/lib/deploy/database/prepare.js +2 -3
  22. package/lib/deploy/extensions/secrets.js +3 -3
  23. package/lib/deploy/functions/build.js +3 -2
  24. package/lib/deploy/functions/ensure.js +1 -11
  25. package/lib/deploy/functions/prepare.js +3 -13
  26. package/lib/deploy/functions/prepareFunctionsUpload.js +2 -3
  27. package/lib/deploy/functions/release/fabricator.js +0 -1
  28. package/lib/deploy/functions/release/index.js +1 -5
  29. package/lib/deploy/functions/runtimes/discovery/index.js +18 -3
  30. package/lib/deploy/functions/runtimes/discovery/v1alpha1.js +3 -2
  31. package/lib/deploy/functions/runtimes/golang/index.js +2 -22
  32. package/lib/deploy/functions/runtimes/node/index.js +3 -7
  33. package/lib/deploy/functions/runtimes/node/parseTriggers.js +1 -1
  34. package/lib/deploy/lifecycleHooks.js +7 -10
  35. package/lib/deploy/storage/prepare.js +1 -1
  36. package/lib/emulator/auth/index.js +1 -1
  37. package/lib/emulator/auth/operations.js +336 -64
  38. package/lib/emulator/auth/server.js +2 -2
  39. package/lib/emulator/auth/state.js +32 -7
  40. package/lib/emulator/commandUtils.js +1 -1
  41. package/lib/emulator/constants.js +1 -1
  42. package/lib/emulator/controller.js +6 -5
  43. package/lib/emulator/databaseEmulator.js +2 -2
  44. package/lib/emulator/download.js +1 -1
  45. package/lib/emulator/events/types.js +2 -3
  46. package/lib/emulator/firestoreEmulator.js +2 -2
  47. package/lib/emulator/functionsEmulator.js +27 -37
  48. package/lib/emulator/functionsEmulatorRuntime.js +7 -7
  49. package/lib/emulator/hostingEmulator.js +1 -1
  50. package/lib/emulator/hub.js +1 -1
  51. package/lib/emulator/loggingEmulator.js +1 -1
  52. package/lib/emulator/pubsubEmulator.js +1 -1
  53. package/lib/emulator/storage/crc.js +4 -4
  54. package/lib/emulator/storage/index.js +1 -1
  55. package/lib/emulator/types.js +1 -1
  56. package/lib/extensions/askUserForConsent.js +1 -2
  57. package/lib/extensions/askUserForParam.js +15 -18
  58. package/lib/extensions/emulator/optionsHelper.js +4 -4
  59. package/lib/extensions/extensionsApi.js +1 -22
  60. package/lib/extensions/extensionsHelper.js +6 -6
  61. package/lib/extensions/listExtensions.js +9 -10
  62. package/lib/extensions/manifest.js +2 -2
  63. package/lib/extensions/resolveSource.js +11 -7
  64. package/lib/extensions/secretsUtils.js +3 -3
  65. package/lib/extensions/types.js +24 -0
  66. package/lib/extensions/updateHelper.js +1 -1
  67. package/lib/extensions/utils.js +1 -2
  68. package/lib/extensions/warnings.js +3 -3
  69. package/lib/firestore/encodeFirestoreValue.js +11 -8
  70. package/lib/fsAsync.js +3 -3
  71. package/lib/functionsConfig.js +17 -14
  72. package/lib/functionsConfigClone.js +10 -12
  73. package/lib/gcp/cloudfunctions.js +2 -15
  74. package/lib/gcp/rules.js +1 -1
  75. package/lib/gcp/runtimeconfig.js +2 -2
  76. package/lib/hosting/proxy.js +1 -1
  77. package/lib/init/features/hosting/github.js +1 -1
  78. package/lib/init/features/hosting/index.js +2 -2
  79. package/lib/localFunction.js +4 -4
  80. package/lib/previews.js +1 -1
  81. package/lib/profileReport.js +10 -10
  82. package/lib/prompt.js +1 -2
  83. package/lib/rc.js +1 -1
  84. package/lib/rulesDeploy.js +2 -2
  85. package/lib/serve/index.js +4 -5
  86. package/lib/utils.js +30 -6
  87. package/npm-shrinkwrap.json +2 -2
  88. package/package.json +10 -9
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.prepare = void 0;
4
- const _ = require("lodash");
5
4
  const clc = require("cli-color");
6
5
  const path = require("path");
7
6
  const error_1 = require("../../error");
@@ -24,7 +23,7 @@ function prepare(context, options) {
24
23
  ruleFiles[ruleConfig.rules] = null;
25
24
  deploys.push(ruleConfig);
26
25
  });
27
- _.forEach(ruleFiles, (v, file) => {
26
+ for (const file of Object.keys(ruleFiles)) {
28
27
  switch (path.extname(file)) {
29
28
  case ".json":
30
29
  ruleFiles[file] = options.config.readProjectFile(file);
@@ -35,7 +34,7 @@ function prepare(context, options) {
35
34
  default:
36
35
  throw new error_1.FirebaseError("Unexpected rules format " + path.extname(file));
37
36
  }
38
- });
37
+ }
39
38
  context.database = {
40
39
  deploys: deploys,
41
40
  ruleFiles: ruleFiles,
@@ -6,7 +6,7 @@ const secretUtils = require("../../extensions/secretsUtils");
6
6
  const secretManager = require("../../gcp/secretManager");
7
7
  const planner_1 = require("./planner");
8
8
  const askUserForParam_1 = require("../../extensions/askUserForParam");
9
- const extensionsApi_1 = require("../../extensions/extensionsApi");
9
+ const types_1 = require("../../extensions/types");
10
10
  const error_1 = require("../../error");
11
11
  const logger_1 = require("../../logger");
12
12
  const utils_1 = require("../../utils");
@@ -34,7 +34,7 @@ async function checkSpecForSecrets(i) {
34
34
  }
35
35
  exports.checkSpecForSecrets = checkSpecForSecrets;
36
36
  const secretsInSpec = (spec) => {
37
- return spec.params.filter((p) => p.type === extensionsApi_1.ParamType.SECRET);
37
+ return spec.params.filter((p) => p.type === types_1.ParamType.SECRET);
38
38
  };
39
39
  async function handleSecretsCreateInstance(i, nonInteractive) {
40
40
  const extensionVersion = await (0, planner_1.getExtensionVersion)(i);
@@ -49,7 +49,7 @@ async function handleSecretsUpdateInstance(i, prevSpec, nonInteractive) {
49
49
  const secretParams = secretsInSpec(extensionVersion.spec);
50
50
  for (const s of secretParams) {
51
51
  const prevParam = prevExtensionVersion.spec.params.find((p) => p.param === s.param);
52
- if ((prevParam === null || prevParam === void 0 ? void 0 : prevParam.type) === extensionsApi_1.ParamType.SECRET && prevSpec.params[prevParam === null || prevParam === void 0 ? void 0 : prevParam.param]) {
52
+ if ((prevParam === null || prevParam === void 0 ? void 0 : prevParam.type) === types_1.ParamType.SECRET && prevSpec.params[prevParam === null || prevParam === void 0 ? void 0 : prevParam.param]) {
53
53
  await handleSecretParamForUpdate(s, i, prevSpec.params[prevParam === null || prevParam === void 0 ? void 0 : prevParam.param], nonInteractive);
54
54
  }
55
55
  else {
@@ -93,8 +93,9 @@ function resolveBackend(build, userEnvs) {
93
93
  };
94
94
  proto.copyIfPresent(bkEndpoint.vpc, bdEndpoint.vpc, "egressSettings");
95
95
  }
96
- if (bdEndpoint.serviceAccount) {
97
- bkEndpoint.serviceAccountEmail = bdEndpoint.serviceAccount;
96
+ proto.renameIfPresent(bkEndpoint, bdEndpoint, "serviceAccountEmail", "serviceAccount");
97
+ if ("serviceAccountEmail" in bkEndpoint && !bdEndpoint.serviceAccount) {
98
+ delete bkEndpoint.serviceAccountEmail;
98
99
  }
99
100
  bkEndpoints.push(bkEndpoint);
100
101
  }
@@ -1,17 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.secretAccess = exports.maybeEnableAR = exports.cloudBuildEnabled = exports.defaultServiceAccount = void 0;
3
+ exports.secretAccess = exports.cloudBuildEnabled = exports.defaultServiceAccount = void 0;
4
4
  const clc = require("cli-color");
5
5
  const ensureApiEnabled_1 = require("../../ensureApiEnabled");
6
6
  const error_1 = require("../../error");
7
7
  const utils_1 = require("../../utils");
8
8
  const secretManager_1 = require("../../gcp/secretManager");
9
- const previews_1 = require("../../previews");
10
9
  const projects_1 = require("../../management/projects");
11
10
  const functional_1 = require("../../functional");
12
11
  const track_1 = require("../../track");
13
12
  const backend = require("./backend");
14
- const ensureApiEnabled = require("../../ensureApiEnabled");
15
13
  const FAQ_URL = "https://firebase.google.com/support/faq#functions-runtime";
16
14
  const CLOUD_BUILD_API = "cloudbuild.googleapis.com";
17
15
  async function defaultServiceAccount(e) {
@@ -66,14 +64,6 @@ async function cloudBuildEnabled(projectId) {
66
64
  }
67
65
  }
68
66
  exports.cloudBuildEnabled = cloudBuildEnabled;
69
- async function maybeEnableAR(projectId) {
70
- if (!previews_1.previews.artifactregistry) {
71
- return ensureApiEnabled.check(projectId, "artifactregistry.googleapis.com", "functions", true);
72
- }
73
- await ensureApiEnabled.ensure(projectId, "artifactregistry.googleapis.com", "functions");
74
- return true;
75
- }
76
- exports.maybeEnableAR = maybeEnableAR;
77
67
  async function secretsToServiceAccounts(b) {
78
68
  const secretsToSa = {};
79
69
  for (const e of backend.allEndpoints(b)) {
@@ -21,7 +21,6 @@ const triggerRegionHelper_1 = require("./triggerRegionHelper");
21
21
  const checkIam_1 = require("./checkIam");
22
22
  const error_1 = require("../../error");
23
23
  const projectConfig_1 = require("../../functions/projectConfig");
24
- const previews_1 = require("../../previews");
25
24
  const v1_1 = require("../../functions/events/v1");
26
25
  const serviceusage_1 = require("../../gcp/serviceusage");
27
26
  function hasUserConfig(config) {
@@ -40,9 +39,8 @@ async function prepare(context, options, payload) {
40
39
  ensureApiEnabled.ensure(projectId, "cloudfunctions.googleapis.com", "functions"),
41
40
  ensureApiEnabled.check(projectId, "runtimeconfig.googleapis.com", "runtimeconfig", true),
42
41
  ensure.cloudBuildEnabled(projectId),
43
- ensure.maybeEnableAR(projectId),
42
+ ensureApiEnabled.check(projectId, "artifactregistry.googleapis.com", "artifactregistry"),
44
43
  ]);
45
- context.artifactRegistryEnabled = checkAPIsEnabled[3];
46
44
  const firebaseConfig = await functionsConfig.getFirebaseConfig(options);
47
45
  context.firebaseConfig = firebaseConfig;
48
46
  let runtimeConfig = { firebase: firebaseConfig };
@@ -79,15 +77,8 @@ async function prepare(context, options, payload) {
79
77
  };
80
78
  const userEnvs = functionsEnv.loadUserEnvs(userEnvOpt);
81
79
  const envs = Object.assign(Object.assign({}, userEnvs), firebaseEnvs);
82
- let wantBackend;
83
- if (previews_1.previews.functionsparams) {
84
- const wantBuild = await runtimeDelegate.discoverBuild(runtimeConfig, firebaseEnvs);
85
- wantBackend = build.resolveBackend(wantBuild, userEnvs);
86
- }
87
- else {
88
- logger_1.logger.debug(`Analyzing ${runtimeDelegate.name} backend spec`);
89
- wantBackend = await runtimeDelegate.discoverSpec(runtimeConfig, firebaseEnvs);
90
- }
80
+ const wantBuild = await runtimeDelegate.discoverBuild(runtimeConfig, firebaseEnvs);
81
+ const wantBackend = build.resolveBackend(wantBuild, userEnvs);
91
82
  wantBackend.environmentVariables = envs;
92
83
  for (const endpoint of backend.allEndpoints(wantBackend)) {
93
84
  endpoint.environmentVariables = wantBackend.environmentVariables;
@@ -145,7 +136,6 @@ async function prepare(context, options, payload) {
145
136
  }));
146
137
  if (backend.someEndpoint(wantBackend, (e) => e.platform === "gcfv2")) {
147
138
  const V2_APIS = [
148
- "artifactregistry.googleapis.com",
149
139
  "run.googleapis.com",
150
140
  "eventarc.googleapis.com",
151
141
  "pubsub.googleapis.com",
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.prepareFunctionsUpload = exports.getFunctionsConfig = void 0;
4
- const _ = require("lodash");
5
4
  const archiver = require("archiver");
6
5
  const clc = require("cli-color");
7
6
  const filesize = require("filesize");
@@ -54,12 +53,12 @@ async function packageSource(sourceDir, config, runtimeConfig) {
54
53
  ignore.push("firebase-debug.log", "firebase-debug.*.log", CONFIG_DEST_FILE);
55
54
  try {
56
55
  const files = await fsAsync.readdirRecursive({ path: sourceDir, ignore: ignore });
57
- _.forEach(files, (file) => {
56
+ for (const file of files) {
58
57
  archive.file(file.name, {
59
58
  name: path.relative(sourceDir, file.name),
60
59
  mode: file.mode,
61
60
  });
62
- });
61
+ }
63
62
  if (typeof runtimeConfig !== "undefined") {
64
63
  archive.append(JSON.stringify(runtimeConfig, null, 2), {
65
64
  name: CONFIG_DEST_FILE,
@@ -36,7 +36,6 @@ const gcfV2PollerOptions = {
36
36
  masterTimeout: 25 * 60 * 1000,
37
37
  maxBackoff: 10000,
38
38
  };
39
- const DEFAULT_GCFV2_CONCURRENCY = 80;
40
39
  const rethrowAs = (endpoint, op) => (err) => {
41
40
  logger_1.logger.error(err.message);
42
41
  throw new reporter.DeploymentError(endpoint, op, err);
@@ -63,11 +63,7 @@ async function release(context, options, payload) {
63
63
  const deletedEndpoints = Object.values(plan)
64
64
  .map((r) => r.endpointsToDelete)
65
65
  .reduce(functional_1.reduceFlat, []);
66
- const opts = {};
67
- if (!context.artifactRegistryEnabled) {
68
- opts.ar = new containerCleaner.NoopArtifactRegistryCleaner();
69
- }
70
- await containerCleaner.cleanupBuildImages(haveEndpoints, deletedEndpoints, opts);
66
+ await containerCleaner.cleanupBuildImages(haveEndpoints, deletedEndpoints);
71
67
  const allErrors = summary.results.filter((r) => r.error).map((r) => r.error);
72
68
  if (allErrors.length) {
73
69
  const opts = allErrors.length === 1 ? { original: allErrors[0] } : { children: allErrors };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.detectFromPort = exports.detectFromYaml = exports.yamlToBackend = exports.readFileAsync = void 0;
3
+ exports.detectFromPort = exports.detectFromYaml = exports.yamlToBuild = exports.yamlToBackend = exports.readFileAsync = void 0;
4
4
  const node_fetch_1 = require("node-fetch");
5
5
  const fs = require("fs");
6
6
  const path = require("path");
@@ -26,6 +26,21 @@ function yamlToBackend(yaml, project, region, runtime) {
26
26
  }
27
27
  }
28
28
  exports.yamlToBackend = yamlToBackend;
29
+ function yamlToBuild(yaml, project, region, runtime) {
30
+ try {
31
+ if (!yaml.specVersion) {
32
+ throw new error_1.FirebaseError("Expect manifest yaml to specify a version number");
33
+ }
34
+ if (yaml.specVersion === "v1alpha1") {
35
+ return v1alpha1.buildFromV1Alpha1(yaml, project, region, runtime);
36
+ }
37
+ throw new error_1.FirebaseError("It seems you are using a newer SDK than this version of the CLI can handle. Please update your CLI with `npm install -g firebase-tools`");
38
+ }
39
+ catch (err) {
40
+ throw new error_1.FirebaseError("Failed to parse build specification", { children: [err] });
41
+ }
42
+ }
43
+ exports.yamlToBuild = yamlToBuild;
29
44
  async function detectFromYaml(directory, project, runtime) {
30
45
  let text;
31
46
  try {
@@ -42,7 +57,7 @@ async function detectFromYaml(directory, project, runtime) {
42
57
  }
43
58
  logger_1.logger.debug("Found functions.yaml. Got spec:", text);
44
59
  const parsed = yaml.load(text);
45
- return yamlToBackend(parsed, project, api.functionsDefaultRegion, runtime);
60
+ return yamlToBuild(parsed, project, api.functionsDefaultRegion, runtime);
46
61
  }
47
62
  exports.detectFromYaml = detectFromYaml;
48
63
  async function detectFromPort(port, project, runtime, timeout = 30000) {
@@ -74,6 +89,6 @@ async function detectFromPort(port, project, runtime, timeout = 30000) {
74
89
  logger_1.logger.debug("Failed to parse functions.yaml", err);
75
90
  throw new error_1.FirebaseError(`Failed to load function definition from source: ${text}`);
76
91
  }
77
- return yamlToBackend(parsed, project, api.functionsDefaultRegion, runtime);
92
+ return yamlToBuild(parsed, project, api.functionsDefaultRegion, runtime);
78
93
  }
79
94
  exports.detectFromPort = detectFromPort;
@@ -200,7 +200,8 @@ function assertManifestEndpoint(ep, id) {
200
200
  function parseEndpointForBuild(id, ep, project, defaultRegion, runtime) {
201
201
  let triggered;
202
202
  if (backend.isEventTriggered(ep)) {
203
- const _a = ep.eventTrigger, { serviceAccountEmail } = _a, newTrigger = __rest(_a, ["serviceAccountEmail"]);
203
+ const newTrigger = __rest(ep.eventTrigger, []);
204
+ delete newTrigger.serviceAccountEmail;
204
205
  triggered = { eventTrigger: newTrigger };
205
206
  triggered.eventTrigger.serviceAccount = ep.eventTrigger.serviceAccountEmail;
206
207
  (0, proto_1.renameIfPresent)(triggered.eventTrigger, ep.eventTrigger, "channel", "channel", (c) => resolveChannelName(project, c, defaultRegion));
@@ -264,7 +265,7 @@ function parseEndpointForBuild(id, ep, project, defaultRegion, runtime) {
264
265
  "firebase-tools with npm install -g firebase-tools@latest");
265
266
  }
266
267
  const parsed = Object.assign({ platform: ep.platform || "gcfv2", region: ep.region || [defaultRegion], project,
267
- runtime, entryPoint: ep.entryPoint, serviceAccount: ep.serviceAccountEmail || "default" }, triggered);
268
+ runtime, entryPoint: ep.entryPoint, serviceAccount: ep.serviceAccountEmail || null }, triggered);
268
269
  (0, proto_1.copyIfPresent)(parsed, ep, "availableMemoryMb", "maxInstances", "minInstances", "concurrency", "timeoutSeconds", "vpc", "labels", "ingressSettings", "environmentVariables");
269
270
  (0, proto_1.renameIfPresent)(parsed, ep, "secretEnvironmentVariables", "secretEnvironmentVariables", (senvs) => {
270
271
  const secretEnvironmentVariables = [];
@@ -5,11 +5,9 @@ const util_1 = require("util");
5
5
  const node_fetch_1 = require("node-fetch");
6
6
  const fs = require("fs");
7
7
  const path = require("path");
8
- const portfinder = require("portfinder");
9
8
  const spawn = require("cross-spawn");
10
9
  const error_1 = require("../../../../error");
11
10
  const logger_1 = require("../../../../logger");
12
- const discovery = require("../discovery");
13
11
  const gomod = require("./gomod");
14
12
  const VERSION_TO_RUNTIME = {
15
13
  "1.13": "go113",
@@ -105,26 +103,8 @@ class Delegate {
105
103
  return p;
106
104
  });
107
105
  }
108
- async discoverBuild(configValues, envs) {
109
- return { requiredAPIs: [], endpoints: {}, params: [] };
110
- }
111
- async discoverSpec(configValues, envs) {
112
- let discovered = await discovery.detectFromYaml(this.sourceDir, this.projectId, this.runtime);
113
- if (!discovered) {
114
- const getPort = (0, util_1.promisify)(portfinder.getPort);
115
- const port = await getPort();
116
- portfinder.basePort = port + 1;
117
- const adminPort = await getPort();
118
- const kill = await this.serve(port, adminPort, envs);
119
- try {
120
- discovered = await discovery.detectFromPort(adminPort, this.projectId, this.runtime);
121
- }
122
- finally {
123
- await kill();
124
- }
125
- }
126
- discovered.environmentVariables = envs;
127
- return discovered;
106
+ async discoverBuild() {
107
+ return Promise.resolve({ requiredAPIs: [], endpoints: {}, params: [] });
128
108
  }
129
109
  }
130
110
  exports.Delegate = Delegate;
@@ -85,15 +85,15 @@ class Delegate {
85
85
  return p;
86
86
  });
87
87
  }
88
- async discoverSpec(config, env) {
88
+ async discoverBuild(config, env) {
89
89
  if (!semver.valid(this.sdkVersion)) {
90
90
  logger_1.logger.debug(`Could not parse firebase-functions version '${this.sdkVersion}' into semver. Falling back to parseTriggers.`);
91
- return parseTriggers.discoverBackend(this.projectId, this.sourceDir, this.runtime, config, env);
91
+ return parseTriggers.discoverBuild(this.projectId, this.sourceDir, this.runtime, config, env);
92
92
  }
93
93
  if (semver.lt(this.sdkVersion, MIN_FUNCTIONS_SDK_VERSION)) {
94
94
  (0, utils_1.logLabeledWarning)("functions", `You are using an old version of firebase-functions SDK (${this.sdkVersion}). ` +
95
95
  `Please update firebase-functions SDK to >=${MIN_FUNCTIONS_SDK_VERSION}`);
96
- return parseTriggers.discoverBackend(this.projectId, this.sourceDir, this.runtime, config, env);
96
+ return parseTriggers.discoverBuild(this.projectId, this.sourceDir, this.runtime, config, env);
97
97
  }
98
98
  let discovered = await discovery.detectFromYaml(this.sourceDir, this.projectId, this.runtime);
99
99
  if (!discovered) {
@@ -107,11 +107,7 @@ class Delegate {
107
107
  await kill();
108
108
  }
109
109
  }
110
- discovered.environmentVariables = env;
111
110
  return discovered;
112
111
  }
113
- async discoverBuild(config, env) {
114
- return parseTriggers.discoverBuild(this.projectId, this.sourceDir, this.runtime, config, env);
115
- }
116
112
  }
117
113
  exports.Delegate = Delegate;
@@ -45,7 +45,7 @@ function parseTriggers(projectId, sourceDir, configValues, envs) {
45
45
  });
46
46
  });
47
47
  }
48
- function useStrategy(context) {
48
+ function useStrategy() {
49
49
  return Promise.resolve(true);
50
50
  }
51
51
  exports.useStrategy = useStrategy;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.lifecycleHooks = void 0;
4
- const _ = require("lodash");
5
4
  const utils = require("../utils");
6
5
  const clc = require("cli-color");
7
6
  const childProcess = require("child_process");
@@ -54,7 +53,7 @@ function getChildEnvironment(target, overallOptions, config) {
54
53
  default:
55
54
  resourceDir = overallOptions.config.path(overallOptions.config.projectDir);
56
55
  }
57
- return _.assign({}, process.env, {
56
+ return Object.assign({}, process.env, {
58
57
  GCLOUD_PROJECT: projectId,
59
58
  PROJECT_DIR: projectDir,
60
59
  RESOURCE_DIR: resourceDir,
@@ -74,10 +73,8 @@ function runTargetCommands(target, hook, overallOptions, config) {
74
73
  shell: true,
75
74
  stdio: [0, 1, 2],
76
75
  };
77
- const runAllCommands = _.reduce(commands, (soFar, command) => {
78
- return soFar.then(() => {
79
- return runCommand(command, childOptions);
80
- });
76
+ const runAllCommands = commands.reduce((soFar, command) => {
77
+ return soFar.then(() => runCommand(command, childOptions));
81
78
  }, Promise.resolve());
82
79
  let logIdentifier = target;
83
80
  if (config.target) {
@@ -96,14 +93,14 @@ function getReleventConfigs(target, options) {
96
93
  if (!targetConfigs) {
97
94
  return [];
98
95
  }
99
- if (!_.isArray(targetConfigs)) {
96
+ if (!Array.isArray(targetConfigs)) {
100
97
  targetConfigs = [targetConfigs];
101
98
  }
102
99
  if (!options.only) {
103
100
  return targetConfigs;
104
101
  }
105
102
  let onlyTargets = options.only.split(",");
106
- if (_.includes(onlyTargets, target)) {
103
+ if (onlyTargets.includes(target)) {
107
104
  return targetConfigs;
108
105
  }
109
106
  onlyTargets = onlyTargets
@@ -114,12 +111,12 @@ function getReleventConfigs(target, options) {
114
111
  return individualOnly.replace(`${target}:`, "");
115
112
  });
116
113
  return targetConfigs.filter((config) => {
117
- return !config.target || _.includes(onlyTargets, config.target);
114
+ return !config.target || onlyTargets.includes(config.target);
118
115
  });
119
116
  }
120
117
  function lifecycleHooks(target, hook) {
121
118
  return function (context, options) {
122
- return _.reduce(getReleventConfigs(target, options), (previousCommands, individualConfig) => {
119
+ return getReleventConfigs(target, options).reduce((previousCommands, individualConfig) => {
123
120
  return previousCommands.then(() => {
124
121
  return runTargetCommands(target, hook, options, individualConfig);
125
122
  });
@@ -13,7 +13,7 @@ async function default_1(context, options) {
13
13
  _.set(context, "storage.rulesDeploy", rulesDeploy);
14
14
  if (_.isPlainObject(rulesConfig)) {
15
15
  const defaultBucket = await gcp.storage.getDefaultBucket(options.project);
16
- rulesConfig = [_.assign(rulesConfig, { bucket: defaultBucket })];
16
+ rulesConfig = [Object.assign(rulesConfig, { bucket: defaultBucket })];
17
17
  _.set(context, "storage.rules", rulesConfig);
18
18
  }
19
19
  rulesConfig.forEach((ruleConfig) => {
@@ -26,7 +26,7 @@ class AuthEmulator {
26
26
  return this.destroyServer ? this.destroyServer() : Promise.resolve();
27
27
  }
28
28
  getInfo() {
29
- const host = this.args.host || constants_1.Constants.getDefaultHost(types_1.Emulators.AUTH);
29
+ const host = this.args.host || constants_1.Constants.getDefaultHost();
30
30
  const port = this.args.port || constants_1.Constants.getDefaultPort(types_1.Emulators.AUTH);
31
31
  return {
32
32
  name: this.getName(),