Generalize --force deprecation warning into BaseCommand#7046
Draft
alfonso-noriega wants to merge 2 commits intomainfrom
Draft
Generalize --force deprecation warning into BaseCommand#7046alfonso-noriega wants to merge 2 commits intomainfrom
alfonso-noriega wants to merge 2 commits intomainfrom
Conversation
2 tasks
Contributor
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Contributor
Coverage report
Test suite run success3920 tests passing in 1506 suites. Report generated by 🧪jest coverage report action from 64fd4d9 |
Add a `deprecated()` helper to BaseCommand that attaches a deprecation warning
to any flag definition, and a private `showDeprecatedFlagWarnings()` method that
fires the warning automatically during `parse()` when the flag is used. Remove
the manual `if (flags.force) { renderWarning(...) }` blocks from deploy.ts and
release.ts in favour of wrapping the flag declarations with `deprecated()`.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Move showDeprecatedFlagWarnings to after all protected methods, alongside the other private methods. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
b8bd1d7 to
8889ed3
Compare
805fe37 to
64fd4d9
Compare
Contributor
Differences in type declarationsWe detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:
New type declarationsWe found no new type declarations in this PR Existing type declarationspackages/cli-kit/dist/public/node/base-command.d.ts@@ -1,7 +1,9 @@
+import { RenderAlertOptions } from './ui.js';
import { Command } from '@oclif/core';
import { OutputFlags, Input, ParserOutput, FlagInput, OutputArgs } from '@oclif/core/parser';
export type ArgOutput = OutputArgs<any>;
export type FlagOutput = OutputFlags<any>;
+export declare function deprecated<T>(flag: T, warning: RenderAlertOptions): T;
declare abstract class BaseCommand extends Command {
static baseFlags: FlagInput<{}>;
static descriptionWithoutMarkdown(): string | undefined;
@@ -21,6 +23,7 @@ declare abstract class BaseCommand extends Command {
}>;
protected environmentsFilename(): string | undefined;
protected failMissingNonTTYFlags(flags: FlagOutput, requiredFlags: string[]): void;
+ private showDeprecatedFlagWarnings;
private resultWithEnvironment;
/**
* Tries to load an environment to forward to the command. If no environment
|
Base automatically changed from
03-12-deprecate_force_flag_on_deploy_and_release
to
main
March 20, 2026 09:55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

WHY are these changes introduced?
Fixes #0000
WHAT is this pull request doing?
How to test your changes?
Post-release steps
Measuring impact
How do we know this change was effective? Please choose one:
Checklist