Skip to content

[cli] Strongly type TelemetryClient subclasses against command specification#12426

Merged
kodiakhq[bot] merged 9 commits intomainfrom
tootallnate/zero-2811-strongly-type-telemetryclient-subclasses-against-command
Oct 30, 2024
Merged

[cli] Strongly type TelemetryClient subclasses against command specification#12426
kodiakhq[bot] merged 9 commits intomainfrom
tootallnate/zero-2811-strongly-type-telemetryclient-subclasses-against-command

Conversation

@TooTallNate
Copy link
Copy Markdown
Member

@TooTallNate TooTallNate commented Oct 29, 2024

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

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).

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Oct 29, 2024

🦋 Changeset detected

Latest commit: d63a3b9

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

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

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

…-2811-strongly-type-telemetryclient-subclasses-against-command
@TooTallNate TooTallNate changed the title [cli][WIP] Strongly type TelemetryClient subclasses against command specification [cli][WIP] Strongly type TelemetryClient subclasses against command specification Oct 29, 2024
@TooTallNate TooTallNate marked this pull request as ready for review October 29, 2024 23:43
@TooTallNate TooTallNate changed the title [cli][WIP] Strongly type TelemetryClient subclasses against command specification [cli] Strongly type TelemetryClient subclasses against command specification Oct 29, 2024
@kodiakhq kodiakhq bot merged commit 4f49d94 into main Oct 30, 2024
@kodiakhq kodiakhq bot deleted the tootallnate/zero-2811-strongly-type-telemetryclient-subclasses-against-command branch October 30, 2024 15:21
onsclom pushed a commit that referenced this pull request Oct 30, 2024
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## [email protected]

### Minor Changes

- Strongly type `TelemetryClient` subclasses against command
specification ([#12426](#12426))

- Adds `vercel integration remove` to uninstall Marketplace integrations
from the current team
([#12291](#12291))
Adds `vercel integration-resource disconnect` to disconnect Marketplace
integration resources from projects
Adds `vercel integration-resource remove` to delete Marketplace
integration resources

### Patch Changes

- [cli] Make all metrics tracking methods on the store require arguments
([#12422](#12422))

- Support allowHeader from Next.js for filtering request headers during
revalidation ([#12420](#12420))

- [cli] don't track unreachable condition
([#12419](#12419))

- Updated dependencies
\[[`5a6605bbd99c3b4c3f06fc315dd3978fe7801d00`](5a6605b)]:
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]

## @vercel/functions@1.5.0

### Minor Changes

- ipAddress: accept headers as input
([#12429](#12429))

## @vercel/[email protected]

### Patch Changes

- Support allowHeader from Next.js for filtering request headers during
revalidation ([#12420](#12420))

## @vercel/[email protected]

### Patch Changes

- Updated dependencies
\[[`5a6605bbd99c3b4c3f06fc315dd3978fe7801d00`](5a6605b)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Updated dependencies
\[[`5a6605bbd99c3b4c3f06fc315dd3978fe7801d00`](5a6605b)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Support allowHeader from Next.js for filtering request headers during
revalidation ([#12420](#12420))

## @vercel/[email protected]

### Patch Changes

- Updated dependencies
\[[`5a6605bbd99c3b4c3f06fc315dd3978fe7801d00`](5a6605b)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

-   Updated dependencies \[]:
    -   @vercel/[email protected]

## @vercel-internals/[email protected]

### Patch Changes

- Updated dependencies
\[[`5a6605bbd99c3b4c3f06fc315dd3978fe7801d00`](5a6605b)]:
    -   @vercel/[email protected]

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
QuietCraftsmanship pushed a commit to QuietCraftsmanship/Vercel that referenced this pull request Jul 6, 2025
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## [email protected]

### Minor Changes

- Strongly type `TelemetryClient` subclasses against command
specification ([#12426](vercel/vercel#12426))

- Adds `vercel integration remove` to uninstall Marketplace integrations
from the current team
([#12291](vercel/vercel#12291))
Adds `vercel integration-resource disconnect` to disconnect Marketplace
integration resources from projects
Adds `vercel integration-resource remove` to delete Marketplace
integration resources

### Patch Changes

- [cli] Make all metrics tracking methods on the store require arguments
([#12422](vercel/vercel#12422))

- Support allowHeader from Next.js for filtering request headers during
revalidation ([#12420](vercel/vercel#12420))

- [cli] don't track unreachable condition
([#12419](vercel/vercel#12419))

- Updated dependencies
\[[`ea72a9f85d9fba806e382ef1a7e52b73f78132d9`](vercel/vercel@ea72a9f)]:
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]

## @vercel/[email protected]

### Minor Changes

- ipAddress: accept headers as input
([#12429](vercel/vercel#12429))

## @vercel/[email protected]

### Patch Changes

- Support allowHeader from Next.js for filtering request headers during
revalidation ([#12420](vercel/vercel#12420))

## @vercel/[email protected]

### Patch Changes

- Updated dependencies
\[[`ea72a9f85d9fba806e382ef1a7e52b73f78132d9`](vercel/vercel@ea72a9f)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Updated dependencies
\[[`ea72a9f85d9fba806e382ef1a7e52b73f78132d9`](vercel/vercel@ea72a9f)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Support allowHeader from Next.js for filtering request headers during
revalidation ([#12420](vercel/vercel#12420))

## @vercel/[email protected]

### Patch Changes

- Updated dependencies
\[[`ea72a9f85d9fba806e382ef1a7e52b73f78132d9`](vercel/vercel@ea72a9f)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

-   Updated dependencies \[]:
    -   @vercel/[email protected]

## @vercel-internals/[email protected]

### Patch Changes

- Updated dependencies
\[[`ea72a9f85d9fba806e382ef1a7e52b73f78132d9`](vercel/vercel@ea72a9f)]:
    -   @vercel/[email protected]

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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