Repository navigation
[unplugin] Declare externalPackages option and fix dead docs link - #1863
Conversation
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@oddurs is attempting to deploy a commit to the Meta Open Source Team on Vercel. A member of the Team first needs to authorize it. |
|
Hi @oddurs! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
core.js reads externalPackages and passes it to package discovery as explicitPackages, and unplugin.mdx documents it, but it was never declared on UserOptions, and it isn't part of babel-plugin's StyleXOptions either, so passing it from TypeScript was a type error. The same docs page linked to ./babel-plugin.mdx, the only relative link left in the docs and the only one with an .mdx suffix. Pointed it at /docs/api/configuration/babel-plugin like every other internal link. Fixes meta#1563
496da58 to
06afc9e
Compare
externalPackages option to UserOptions type|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
What changed / motivation ?
Two things, both from #1563.
externalPackagesworks but isn't on the type.unpluginFactorydestructures it and passes it todiscoverStylexPackagesasexplicitPackages(src/core.js), andunplugin.mdxdocuments it, butUserOptionsinsrc/core.d.tsnever declared it, and it isn't in the babel-pluginStyleXOptionsthatUserOptionsintersects either:Declaring it on
UserOptionscovers all the adapters at once, since vite, webpack, esbuild and the rest take their options from it.The other half of the issue is the link to the babel-plugin page.
./babel-plugin.mdxturns out to be the only relative link left in the docs and the only one with an.mdxsuffix; everything else is an absolute/docs/...path. Made it match.Linked PR/Issues
Fixes #1563
Additional Context
Types and docs only, nothing changes at runtime.
I left the
## Options (shared)heading as it is, though I suspect that's what led to the issue describingexternalPackagesas an option shared from the babel plugin. Happy to reword it if you want.Pre-flight checklist