Skip to content

[cli] tidy up some command structures#12103

Closed
trek wants to merge 6 commits intomainfrom
trerika/distribute-flags
Closed

[cli] tidy up some command structures#12103
trek wants to merge 6 commits intomainfrom
trerika/distribute-flags

Conversation

@trek
Copy link
Copy Markdown
Contributor

@trek trek commented Sep 11, 2024

We initially thought these were only used for generating help docs, but discovered they are in fact used in parsing arg/options since #11929. Instead of one large PR, we'll be pulling these changes in incrementally as we add telemetry to each command.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Sep 11, 2024

🦋 Changeset detected

Latest commit: 611555b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
vercel Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

kodiakhq bot pushed a commit that referenced this pull request Oct 30, 2024
…ification (#12426)

Do some TypeScript magic to construct an interface with the expected method names and function signatures, and make `TelemetryClient` subclasses implement those interfaces.

This will ensure that we are not missing any arguments / options. TypeScript will show errors if there is any missing or incompatible methods:

![Screenshot 2024-10-29 at 14 56 36](https://github.com/user-attachments/assets/8e0993fb-99ed-436a-a868-aeab26c2579f)

This PR already uncovered a few arguments that were missed being traced:

* Added missing argument tracing for `vercel promote`
* Added missing argument tracing for `vercel pull`
* Added missing argument tracing for `vercel remove`
* More consistent argument naming - for example an argument that can take a deployment ID or URL is now defined as `url|deploymentId`, which makes both the telemetry and the `--help` output more consistent

**NOTE:** This PR is only addressing the commands which do not themselves have subcommands. We can follow up and finish the swing on implementing these interfaces for such commands after the command specifications have all been individualized (#12103).
kodiakhq bot pushed a commit that referenced this pull request Oct 31, 2024
… command specification (#12446)

* Adds the `subcommads` Telemetry methods (i.e. `trackCliSubcommandOpen()`) to the strong typing generic type.
* Applies the interface to the `vercel integration` family of (sub)commands, since their commands specification data is already in the correct format.

For the rest of the (sub)commands, we still need to wait for #12103, but at least the generic type is now prepared for `subcommands` to be properly defined in the commands' spec.
@TooTallNate TooTallNate deleted the trerika/distribute-flags branch November 10, 2024 08:04
@trek
Copy link
Copy Markdown
Contributor Author

trek commented Nov 11, 2024

@TooTallNate 🫡

QuietCraftsmanship pushed a commit to QuietCraftsmanship/Vercel that referenced this pull request Jul 6, 2025
…ification (#12426)

Do some TypeScript magic to construct an interface with the expected method names and function signatures, and make `TelemetryClient` subclasses implement those interfaces.

This will ensure that we are not missing any arguments / options. TypeScript will show errors if there is any missing or incompatible methods:

![Screenshot 2024-10-29 at 14 56 36](https://github.com/user-attachments/assets/8e0993fb-99ed-436a-a868-aeab26c2579f)

This PR already uncovered a few arguments that were missed being traced:

* Added missing argument tracing for `vercel promote`
* Added missing argument tracing for `vercel pull`
* Added missing argument tracing for `vercel remove`
* More consistent argument naming - for example an argument that can take a deployment ID or URL is now defined as `url|deploymentId`, which makes both the telemetry and the `--help` output more consistent

**NOTE:** This PR is only addressing the commands which do not themselves have subcommands. We can follow up and finish the swing on implementing these interfaces for such commands after the command specifications have all been individualized (vercel/vercel#12103).
QuietCraftsmanship pushed a commit to QuietCraftsmanship/Vercel that referenced this pull request Jul 6, 2025
… command specification (#12446)

* Adds the `subcommads` Telemetry methods (i.e. `trackCliSubcommandOpen()`) to the strong typing generic type.
* Applies the interface to the `vercel integration` family of (sub)commands, since their commands specification data is already in the correct format.

For the rest of the (sub)commands, we still need to wait for vercel/vercel#12103, but at least the generic type is now prepared for `subcommands` to be properly defined in the commands' spec.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants