Introduce a convention for packages to define their auto import patterns
Describe the feature
It doesn't scale well for us to maintain all the presets for every single library. It would also be hard to align the version of each library, especially for major changes.
I propose we have a convention for each library to define its own auto-import entries. For example, a unimport.json file is published along with the npm package. This would make library authors easier to control and maintain the entires, it also naturally solve the problem of version controls.
We already have auto-scan as https://github.com/unjs/unimport#exports-auto-scan, introduced in https://github.com/unjs/unimport/pull/104; in the PR, we also mentioned the potential of this but never got implemented. I want to have this PR to bring back the discussion of the design.
A few ideas for the approach:
- A.
unimport.jsonordist/unimport.jsonfile. - B.
meta.unimportfield in package.json - C.
/unimportsub-export (that supports JS)
Additional information
- [X] Would you be willing to help implement this feature?