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

Auto-complete of plugin names in preset #2155

Merged
merged 4 commits into from
Aug 16, 2024
Merged

Conversation

benjie
Copy link
Member

@benjie benjie commented Aug 16, 2024

Description

When you define a plugin, declare you've done so:

declare global {
  namespace GraphileConfig {
    interface Plugins {
      MyPlugin: true
    }
  }
}

const plugin: GraphileConfig.Plugin = {
  name: "MyPlugin",

Then the plugin will show up in the TypeScript auto-complete:

image

Fixes graphile/crystal-pre-merge#174

Performance impact

None.

Security impact

None.

Checklist

  • My code matches the project's code style and yarn lint:fix passes.
  • I've added tests for the new feature, and yarn test passes.
  • I have detailed the new feature in the relevant documentation.
  • I have added this feature to 'Pending' in the RELEASE_NOTES.md file (if one exists).
  • If this is a breaking change I've explained why.

…tion of known plugin names. Other names are still accepted without error, so this is just a minor DX improvement rather than type safety.
Copy link

changeset-bot bot commented Aug 16, 2024

🦋 Changeset detected

Latest commit: 792988e

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

This PR includes changesets to release 17 packages
Name Type
graphile-build-pg Patch
graphile-build Patch
postgraphile Patch
graphile-config Patch
graphile-utils Patch
pgl Patch
graphile Patch
@localrepo/grafast-bench Patch
@dataplan/pg Patch
grafast Patch
@grafserv/persisted Patch
grafserv Patch
ruru Patch
@dataplan/json Patch
ruru-components Patch
@localrepo/grafast-website Patch
graphile-export 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

@benjie benjie merged commit 54c9027 into main Aug 16, 2024
36 checks passed
@benjie benjie deleted the config-plugin-name-autocomplete branch August 16, 2024 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

See if it's possible to have TypeScript autocomplete disablePlugins names
1 participant