also looking at this
stacks/bun-plugin-auto-imports
fix: resolve generated export collisions consistently
#1186
3 files
+107
-5
| @@ -93,6 +93,15 @@ declarations, and as the fourth argument to `generateGlobalsScript()`. This keep | ||
| 93 | 93 | generated package imports stable when the consumer directory or install layout |
| 94 | 94 | changes. The package must export every returned specifier. |
| 95 | 95 | |
| 96 | ### Export name collisions | |
| 97 | ||
| 98 | Directory scans use the caller's directory order and sorted file paths. The first | |
| 99 | registration of an exported name wins, matching auto-import injection. Runtime | |
| 100 | indexes, their returned export metadata, globals scripts and global declarations | |
| 101 | use that same selection. Repeated overload signatures and re-exports do not emit | |
| 102 | duplicate names. Import a module explicitly when helpers in different modules | |
| 103 | share a name but have different meanings. | |
| 104 | ||
| 96 | 105 | ## Testing |
| 97 | 106 | |
| 98 | 107 | ```bash |