Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: creation of a new interface for combined target + client installation #206

Merged
merged 1 commit into from
Oct 25, 2023

Conversation

erunion
Copy link
Member

@erunion erunion commented Oct 25, 2023

🧰 Changes

In @readme/oas-to-snippet right now the way we're installing httpsnippet-client-api is the following:

addTargetClient('node', HTTPSnippetSimpleApiClient);

This works normally but because we'd love to have folks create their own client plugins and give us NPM packages we don't want to have to supply a target for these plugins when it's easier if the plugin can define that themselves.

The work I've done here is to create a new addClientPlugin hook for installing a one of these target + client combinations and then also a new ClientPlugin interface that combines the two so we can enforce that plugins are properly defined:

interface ClientPlugin {
  client: Client;
  target: TargetId;
}

With all this work we'll be able to now execute the folllowing to install httpsnippet-client-api (once it's been converted to this new system of course):

addClientPlugin(HTTPSnippetSimpleApiClient);

@erunion erunion added the enhancement New feature or request label Oct 25, 2023
@erunion erunion changed the title feat: creation of a new addClientPlugin interface for target+client installation feat: creation of a new interface for combined target + client installation Oct 25, 2023
@erunion erunion force-pushed the feat/plugin-system branch from e9db671 to da9682f Compare October 25, 2023 21:50
@erunion erunion requested a review from kanadgupta October 25, 2023 21:50
@erunion erunion merged commit 3d25fef into main Oct 25, 2023
11 checks passed
@erunion erunion deleted the feat/plugin-system branch October 25, 2023 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant