mdx-js / mdx

Markdown for the component era
https://mdxjs.com
MIT License
17.76k stars 1.14k forks source link

Fix types, lints in example #2518

Closed karlhorky closed 4 months ago

karlhorky commented 4 months ago

Initial checklist

Description of changes

Small follow-up to #2517 to address the type checking and linting problems with the original code from the Bun docs

Argument of type 'Plugin' is not assignable to parameter of type 'BunPlugin'.
  Types of property 'setup' are incompatible.
    Type '(build: PluginBuild) => void | Promise<void>' is not assignable to type '(build: PluginBuilder) => void | Promise<void>'.
      Types of parameters 'build' and 'build' are incompatible.
        Type 'PluginBuilder' is missing the following properties from type 'PluginBuild': initialOptions, resolve, onStart, onEnd, and 2 more. ts (2345)
Promises must be awaited, end with a call to .catch, or end with a call to .then with a rejection handler. eslint (@typescript-eslint/no-floating-promises)
vercel[bot] commented 4 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mdx ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 23, 2024 11:18am
codecov-commenter commented 4 months ago

:warning: Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (908ff45) to head (8d93c6a). Report is 42 commits behind head on main.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2518 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 23 23 Lines 2693 2712 +19 Branches 2 2 ========================================= + Hits 2693 2712 +19 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

wooorm commented 4 months ago

thanks!

wooorm commented 4 months ago

Can you try and build the website next time btw? That actually type checks. And finds other problems, such as that toml wasn’t registered, and that your example uses typescript instead of javascript! https://github.com/mdx-js/mdx/commit/05ecf65f1943e6810b21e40e19354210aa9abefb

karlhorky commented 4 months ago

Ah, sorry for the multiple mistakes there 😬 I am actually working on GitHub only, I don't even have this cloned - just relying on GitHub Actions CI and my memory / reviewing to do the right thing.

Would it make sense to add a "smoke test" website build to the GitHub Actions CI?

For my own PRs for now, I'll keep in mind that things can break without being reported by CI.

wooorm commented 4 months ago

Don’t worry about it! It's intentional that things don't break, so newcomers can contribute, even when they're not as neat in their code as the maintainers! Or, a type error can exist for a bit in an example, while the website remains maintainable. CI did probably show this in the logs btw; if you want to remain in GH but benefit from it, you can go through the logs.