Can it be useful to add importer informations on import.meta for better logs (and errors) ? For instance, a multiple times imported module can log contextualized messages (eg.: in version checker to indicate which module require a specific version ).
import.meta.importer = {
url: 'importer/url',
}
Maybe it can be recursive to get imports chain in some usage
import.meta.importer = {
url: '...',
importer: { ... }
}
It can also be useful to provide a key that refers to the main module (at the top of the imports chain). It allow for instance to execute specific code if current module is the main entry point (eg.: Deno use import.meta.main boolean to execute specific code if the module is not an import)
import.meta.mainModule = {
url: '..',
importer: null //maybe undefined or refers to itself
}
And perhaps add a shorthand for main module test
import.meta.isMain: boolean
//or
import.meta.main: boolean