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

Support nodenext #1056

Merged
merged 1 commit into from
Dec 13, 2023
Merged

Conversation

jonnydgreen
Copy link
Contributor

Closes: #1047

  • I have taken the code as is (to de-risk) and just moved the root level types into the declared namespace, other key bits are detailed as follows:
type Mercurius = typeof mercurius

declare namespace mercurius {
  // ...
  
  export const mercurius: Mercurius
  export { mercurius as default }
}

declare module "fastify" {
  // ...
}

declare function mercurius
  (
    instance: FastifyInstance,
    opts: mercurius.MercuriusOptions
  ): void;

export = mercurius;
  • All the types tests pass and have added some other tests where needed
  • Have taken some inspiration from the fastify repo and other plugins for consistency
  • Have also tested against this repo and all appears to be okay: https://github.com/iamchathu/mercurius-ts-example

@jonnydgreen jonnydgreen self-assigned this Nov 26, 2023
@jonnydgreen
Copy link
Contributor Author

Opening an early PR to get your initial thoughts! Essentially, it's just a lift and shift - but keen to get feedback :)

@jonnydgreen jonnydgreen requested a review from mcollina November 26, 2023 17:08
Copy link
Collaborator

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, this should be good to go

@jonnydgreen jonnydgreen marked this pull request as ready for review November 27, 2023 20:25
@jonnydgreen
Copy link
Contributor Author

Cool - thanks! Just ran some final testing and all good to go :)

@mcollina mcollina merged commit 8ba1a35 into mercurius-js:master Dec 13, 2023
10 checks passed
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.

Types issue with Typescript module resolution node16
2 participants