diff --git a/CHANGELOG.md b/CHANGELOG.md index 63c5cb69fc9..1d7d185e599 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1 +1,2 @@ +- Fixes issue where `ext:*` commands would error out if the `--local` flag was included. This flag is deprecated because it is now the default behavior (#4577). - Improves Node.js version warning for standalone Firebase CLI build (#2791). diff --git a/src/commands/ext-configure.ts b/src/commands/ext-configure.ts index 1a2d2c1633e..9fc1a8f6a71 100644 --- a/src/commands/ext-configure.ts +++ b/src/commands/ext-configure.ts @@ -34,6 +34,7 @@ marked.setOptions({ export default new Command("ext:configure ") .description("configure an existing extension instance") .withForce() + .option("--local", "deprecated") .before(requirePermissions, [ "firebaseextensions.instances.update", "firebaseextensions.instances.get", @@ -49,6 +50,12 @@ export default new Command("ext:configure ") `See https://firebase.google.com/docs/extensions/manifest for more details.` ); } + if (options.local) { + utils.logLabeledWarning( + logPrefix, + "As of firebase-tools@11.0.0, the `--local` flag is no longer required, as it is the default behavior." + ); + } const config = manifest.loadConfig(options); diff --git a/src/commands/ext-install.ts b/src/commands/ext-install.ts index f2913f5e9a2..1ec445c2e21 100644 --- a/src/commands/ext-install.ts +++ b/src/commands/ext-install.ts @@ -48,6 +48,7 @@ export default new Command("ext:install [extensionName]") : "") + "or run with `-i` to see all available extensions." ) + .option("--local", "deprecated") .withForce() .before(requirePermissions, ["firebaseextensions.instances.create"]) .before(ensureExtensionsApiEnabled) @@ -84,6 +85,12 @@ export default new Command("ext:install [extensionName]") `Installing with a source url is no longer supported in the CLI. Please use Firebase Console instead.` ); } + if (options.local) { + utils.logLabeledWarning( + logPrefix, + "As of firebase-tools@11.0.0, the `--local` flag is no longer required, as it is the default behavior." + ); + } // If the user types in a local path (prefixed with ~/, ../, or ./), install from local source. // Otherwise, treat the input as an extension reference and proceed with reference-based installation. diff --git a/src/commands/ext-uninstall.ts b/src/commands/ext-uninstall.ts index 2038970f77c..9b872052043 100644 --- a/src/commands/ext-uninstall.ts +++ b/src/commands/ext-uninstall.ts @@ -4,8 +4,13 @@ import TerminalRenderer = require("marked-terminal"); import { checkMinRequiredVersion } from "../checkMinRequiredVersion"; import { Command } from "../command"; -import { ensureExtensionsApiEnabled, diagnoseAndFixProject } from "../extensions/extensionsHelper"; +import { + ensureExtensionsApiEnabled, + diagnoseAndFixProject, + logPrefix, +} from "../extensions/extensionsHelper"; import { requirePermissions } from "../requirePermissions"; +import { logLabeledWarning } from "../utils"; import * as manifest from "../extensions/manifest"; import { Options } from "../options"; @@ -15,12 +20,19 @@ marked.setOptions({ export default new Command("ext:uninstall ") .description("uninstall an extension that is installed in your Firebase project by instance ID") + .option("--local", "deprecated") .withForce() .before(requirePermissions, ["firebaseextensions.instances.delete"]) .before(ensureExtensionsApiEnabled) .before(checkMinRequiredVersion, "extMinVersion") .before(diagnoseAndFixProject) .action((instanceId: string, options: Options) => { + if (options.local) { + logLabeledWarning( + logPrefix, + "As of firebase-tools@11.0.0, the `--local` flag is no longer required, as it is the default behavior." + ); + } const config = manifest.loadConfig(options); manifest.removeFromManifest(instanceId, config); manifest.showPostDeprecationNotice(); diff --git a/src/commands/ext-update.ts b/src/commands/ext-update.ts index 711d2144fc8..84c24e2f011 100644 --- a/src/commands/ext-update.ts +++ b/src/commands/ext-update.ts @@ -47,11 +47,19 @@ export default new Command("ext:update [updateSource]") .before(ensureExtensionsApiEnabled) .before(checkMinRequiredVersion, "extMinVersion") .before(diagnoseAndFixProject) + .option("--local", "deprecated") .withForce() .action(async (instanceId: string, updateSource: string, options: Options) => { const projectId = getProjectId(options); const config = manifest.loadConfig(options); + if (options.local) { + utils.logLabeledWarning( + logPrefix, + "As of firebase-tools@11.0.0, the `--local` flag is no longer required, as it is the default behavior." + ); + } + const oldRefOrPath = manifest.getInstanceTarget(instanceId, config); if (isLocalPath(oldRefOrPath)) { throw new FirebaseError(